Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ian Brindley 3 posts 74 karma points
    Oct 05, 2016 @ 12:44
    Ian Brindley
    0

    Hiding text on a home page

    HI Want to put some text on my home page that is purely for SEO purposes and do not wish to clutter what is a very nice page. I am therefore considering inserting a "More" link which would reveal the text when clicked. If done this way, would the URL remain as just my homepage URL? (I believe that it needs to) Unless anyone has a better way of achieving this. All ideas welcome. Thanks

  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Oct 05, 2016 @ 12:53
    Dennis Adolfi
    0

    Hi Ian.

    Maybe consider fixing it with jquery, with a More.. toggle?

    http://jsfiddle.net/zA23k/2433/

    Just a quick suggestion..

  • Ian Brindley 3 posts 74 karma points
    Oct 19, 2016 @ 12:17
    Ian Brindley
    0

    Hi, Thanks for the reply and sorry for late response - I've been on holiday. I am a bit of a novice at this stuff so don't want to appear stupid but for each of the sections of code (HTML, JS, CSS) can you advise where these should best reside in Umbraco? For example, I have a page heading as follows:

    Supplying Social Work and Education Jobs across the UK

    I want to add "more" to the end of the heading and bring up some text that I don't want to be normally visible but ensure that the URL is still my home page. Not sure though if this is possible.

    Alternatively, it could really go anywhere on the page so long as it is not visible unless "more" is selected.

    the website is www.entrustsocialcare.co.uk

    Your help is much appreciated

    Thanks

    Ian

  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Oct 19, 2016 @ 13:35
    Dennis Adolfi
    100

    Hi Ian.

    Maybe you could do a textbox for your home node, called "More info". Then in your view:

    <div class="intro-panel">
                  <h1>Supplying <a href="/social-care" class="link-lime">Social Work</a> and <a href="/education" class="link-orange">Education</a> Jobs across the UK</h1>
    
                  <span class="more-info">
    @Model.Content.GetPropertyValue<string>("moreInfo")
    </span>
    
    <span class="more">More</span>
                </div>
    

    In your css file:

    .more-info{
        display:none;
    }
    
    .more{
        color:red;   
        cursor:pointer;
    }
    

    And javascript file:

    $(".more").toggle(function(){
        $(this).text("Less..").siblings(".more-info").show();    
    }, function(){
        $(this).text("More..").siblings(".more-info").hide();    
    });
    

    And then make this a bit pretty maybe, but hopefully this gets you started.

    Best of luck! / Dennis

  • Ian Brindley 3 posts 74 karma points
    Oct 19, 2016 @ 13:38
    Ian Brindley
    1

    Thanks Dennis. Much appreciated

  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Oct 19, 2016 @ 13:40
    Dennis Adolfi
    0

    Glad to help Ian! :)

Please Sign in or register to post replies

Write your reply to:

Draft