Blogger Forums » Blogger Template Tweaks

hiding HTML Widgets on Post pages

(13 posts)
  1. colorsbyk

    member
    Joined: Aug '09
    Posts: 25

    I've set up my gallery blog to have a different HTML widget on each post page and one on the homepage, all containing a table of thumbnails. The homepage widget is working great, but the widgets on the post pages aren't showing up. There's a bit of a gap between the blog header and the post but nothing shows. Any ideas? http://www.colorsbykgallery.blogspot.com

    The widget code is set up like this except for the homepage widget which has data:blog.homepageUrl in place of a URL:

    <b:widget id='HTML4' locked='false' title='abstract' type='HTML'>
    <b:includable id='main'>
    <b:if cond='data:blog.url == "http://www.colorsbykgallery.blogspot.com/2009/08/gallery-abstract.html"'>
    <!-- only display title if it's non-empty -->
    <b:if cond='data:title != ""'>
    <h2 class='title'><data:title/></h2>
    </b:if>
    <div class='widget-content'>
    <data:content/>
    </div>

    <b:include name='quickedit'/>
    </b:if>
    </b:includable>
    </b:widget>

    I thought this was how to set it up, but maybe I'm wrong

    UPDATE >>> I took the conditional tag out of one of the post widgets, but if you go to the post pages, there's still the blank gap above it where the correct widget should be. The empty space below it is supposed to be there

    Posted 2 years ago #
  2. aneesh

    site admin
    Joined: Jul '09
    Posts: 244

    you will have to add some css to totally hide the widgets

    <style>
    #HTML4,#HTML5,#HTML6,#HTML7,#HTML8,#HTML9{display:none;}
    </style>

    will help you to hide the other widgets on this page http://colorsbykgallery.blogspot.com/2009/08/gallery-abstract.html

    So you will have to use proper b:if conditions to implement this..

    Read this also http://www.bloggerplugins.org/2009/06/selective-display-of-blogger-widgets-on.html

    Posted 2 years ago #
  3. colorsbyk

    member
    Joined: Aug '09
    Posts: 25

    Wait so does that style stuff go inside the widget b:if condition for each widget and I just leave out the one that I want to show? Or do I put it inside the <head> section or ???

    Posted 2 years ago #
  4. aneesh

    site admin
    Joined: Jul '09
    Posts: 244

    i think it would be enough to put that inside the widget for normal browsers! but abnormal browsers like IE maynot like you..

    Posted 2 years ago #
  5. colorsbyk

    member
    Joined: Aug '09
    Posts: 25

    Okay, I've tried a ton of variations to get this thing to work and it's still not working for me! Do you think maybe there is some other code in my template that is causing it to not work correctly, or am I just completely clueless? It's reeeeally frustrating because my whole site is dependent on this one feature working.

    Posted 2 years ago #
  6. aneesh

    site admin
    Joined: Jul '09
    Posts: 244

    hmm
    put this just before </head>
    <b:if cond='data:blog.url == "http://colorsbykgallery.blogspot.com/2009/08/gallery-abstract.html"'>
    <style>
    #HTML4,#HTML5,#HTML6,#HTML7,#HTML8,#HTML9{display:none;}
    </style>
    </b:if>

    your blog template codes have changed now!!

    This code will hide the widgets with ids HTML4,HTML5,6,7 and 8 on that particular url.. hope u got it now..

    You will have to make codes for other urls like this one.You will have to change html4,html5 etc with the widget ids of those which are to be hidden on the appropriate pages

    Posted 2 years ago #
  7. colorsbyk

    member
    Joined: Aug '09
    Posts: 25

    I tried that before (it seemed logical) but it didn't work. Must have done something to my code since then because now it's working!!!! Yay!!! Thank you!!!

    Now, just curious (in a hopeful sort of way )...
    Is it possible to hide a single post from the homepage/archives/labels pages using a similar technique - perhaps using the postID#???

    Posted 2 years ago #
  8. aneesh

    site admin
    Joined: Jul '09
    Posts: 244

    yes that too would be possible..

    There is a loop to display posts on homepage etc..

    you will find a corresponding b:loop

    If you apply proper conditional urls withn in then that too should be possible..

    btw these would make your template much much complicated..

    Posted 2 years ago #
  9. colorsbyk

    member
    Joined: Aug '09
    Posts: 25

    What would the proper conditional url look like?

    Posted 2 years ago #
  10. aneesh

    site admin
    Joined: Jul '09
    Posts: 244

    <b:if cond='data:post.url == "The_Particular_Post_Url"'>

    i think this should do the job..

    Posted 2 years ago #
  11. colorsbyk

    member
    Joined: Aug '09
    Posts: 25

    Seems simple enough I can't figure out where to put it.

    Posted 2 years ago #
  12. Obsidian Eagle

    new member
    Joined: Mar '10
    Posts: 1

    Hi! My problem's almost the same, I'm having the hardest time disabling a basic text Widget (I don't want my copyright notice to show up on one specific page). I've tried out many of the methods outlined in the help guide but the best I can succeed at is turning the notice off altogether. Please take a look at the code below and let me know what I'm doing wrong. Thanks a lot in advance!

    -----

    <b:widget id='Text1' locked='false' title='' type='Text'>
    <b:includable id='main'>
    <b:if cond='data:blog.url != "http://obsidianeagle.blogspot.com/p/wall-of-worthies.html"'>
    <!-- only display title if it's non-empty -->

    <b:if cond='data:title != ""'>
    <h2 class='title'><data:title/></h2>
    </b:if></b:if>
    <div class='widget-content'>
    <data:content/>
    </div>

    <b:include name='quickedit'/>
    </b:includable>
    </b:widget>

    -----

    Posted 2 years ago #
  13. aneesh

    site admin
    Joined: Jul '09
    Posts: 244

    it should be like
    <b:widget id='Text1' locked='false' title='' type='Text'>
    <b:includable id='main'>
    <b:if cond='data:blog.url != "http://obsidianeagle.blogspot.com/p/wall-of-worthies.html"'>
    <!-- only display title if it's non-empty -->
    <b:if cond='data:title != ""'>
    <h2 class='title'><data:title/></h2>
    </b:if>
    <div class='widget-content'>
    <data:content/>
    </div>
    <b:include name='quickedit'/>
    </b:if>
    </b:includable>
    </b:widget>

    in your code ,you had closed the b:if improperly. That code will just hide the title of the widget on than that particular page.

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.