Log in | Register | Lost password

Bottom
show or hide item based on URL
  • Posted: 09.12.2006, 03:25
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Hi,

    Question: I am wondering if anyone has worked out how to show or hide an item in a pagesetter template based on the URL.

    Background: i have a 'multisites' postnuke site with two sub domains. (dont worry if you are not familiar with multisites, it is not directly associated with this question) - both sites share the same database, postnuke source & pagesetter templates. that much is working fine.

    Specific: what i want to work out is; how to show or hide a link (url) based on what domain is accessing the template.

    i.e:

    http://sub1.domain.com.au/index.php?module=pagesetter&tid=8
    or
    http://sub2.domain.com.au/index.php?module=pagesetter&tid=8


    with an if/else statement similar to this:

    Code

    <!--[if $core.fullURL?? !=""]-->

    <a href="<!--[$core.fullURL]-->">Link</a>

    <!--[else]-->

    <!--[/if]-->


    i looked at manipulating 'pngetbaseurl' & 'core.fullURL' with smarty escapes to try to get it to work but i think i missed something obvious.
  • Posted: 09.12.2006, 13:30
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    As far as I can recall there is a problem hardcoding permissions in the template since pagesetter caches the output. Even the nocache tags don't work for that.
    see : http://www.pagesetter.net/index.php?module=pagesetter&func=viewpub&tid=4&pid=18


    Maybe you could do it differently using the postnuke permissions system.
    Domain1 default group is users , domain2 default group is prousers...
  • Posted: 09.12.2006, 22:40
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    as the sites use the same database/groups that wont work.

    the URL (sub domain to be precise) is the only separation point.

    this can be attained with 'pngetbaseurl' or 'core.fullURL' but i am not sure what to do from there. none of the if/else statements seem to work. this might have something to do with URL strings (colons & slashes). I don't know the limits of smarty.
  • Posted: 10.12.2006, 07:41
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    i'm going to use CSS to solve this problem, but if anyone can think of an elegant way to manage it with pagesetter/smarty i would be eternally greatful.

Template courtesy of Designs By Darren.