Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Different content depending on static or dynamic pages.

Quote Reply
Different content depending on static or dynamic pages.
I’m having problems with the call when I try to add different content to the links pages depending on if they are static or dynamic.
I’ve tried the following and others without success and used the <%DUMP%> but cannot see anything I can use.

<%if URL contains 'index'%>
Static info
<%else%>
Dynamic info
<%endif%>

<%if get_url contains 'index'%>
Static info
<%else%>
Dynamic info
<%endif%>

If someone could give me any pointers it would be appreciated.

I use index.shtml for static and page.cgi for dynamic.

Thanks

Regards

minesite
Quote Reply
Re: [minesite] Different content depending on static or dynamic pages. In reply to
Hi,

You could try something like this;

<%decide_if_dynamic%>
<%if is_dynamic%>
this means were dynamic
<%else%>
were not in dynamic mode
<%endif%>

Code:
sub {
$ENV{SCRIPT_NAME} ? return { is_dynamic => 1 } : return { is_dynamic => 0 }
}

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Different content depending on static or dynamic pages. In reply to
Wow.... I has having the same issue/question in my mind and didn't knew that such simple solution existed.

Andy, thank you very much for the help over & over again, this small global is for sure going to save me tons of work.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Different content depending on static or dynamic pages. In reply to
No problem Tongue

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Different content depending on static or dynamic pages. In reply to
Hi Andy

Thanks for the reply.

Tried your global exactly as it’s displayed above but can’t get it to work.

Static and Dynamic pages return the same result “this means were dynamic”.

If I just use
Code:
sub {
$ENV{SCRIPT_NAME}
}
To print out SCRIPT_NAME on the pages the
Static page “index.shtml” displays /cgi-bin/nph-build.cgi
and Dynamic page “page.cgi displays /cgi-bin/page.cgi

Is there something I’m doing wrong ?

Thanks

Regards

minesite
Quote Reply
Re: [minesite] Different content depending on static or dynamic pages. In reply to
Hi,

Ah, didn't think about that (I was expecting SCRIPT_NAME} to just be blank when generated by nph-build.cgi - but I guess it isn't :D)

You could try;

Code:
sub {
my $p = $IN->param('g') || $IN->param('p') || $IN->param('page') || $IN->param('d');
$p ? return { is_dynamic => 1 } : return { is_dynamic => 0 }
}

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Different content depending on static or dynamic pages. In reply to
Hi Andy

That does help and works with the page.cgi and index.shtml.

Now, I know your going to swear at me but.................Tongue

I also use a sorting option of city, region and country which are dynamic also using
city.cgi , region.cgi and country.cgi which just show up as static "were not in dynamic mode"

Thanks for your help.

Do you have a wish list at amazon ?Wink

Regards

minesite
Quote Reply
Re: [minesite] Different content depending on static or dynamic pages. In reply to
LOL.. try;

Code:
sub {
my $script = $ENV{SCRIPT_NAME};
if ($script =~ /(city|region|country)\.cgi/i) {
return { is_dynamic => 1 }
}
my $p = $IN->param('g') || $IN->param('p') || $IN->param('page') || $IN->param('d');
$p ? return { is_dynamic => 1 } : return { is_dynamic => 0 }
}

Hope that helps =)

Quote:
Do you have a wish list at amazon ?Wink

Nope.. although I may actually set one up at some point :D I did have one.. but god knows where it is now <G>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Jan 13, 2006, 11:19 AM
Quote Reply
Re: [Andy] Different content depending on static or dynamic pages. In reply to
Hi Andy

Thanks for all you help, works perfectly, get onto that Wishlist and let me know.Wink

When I’m over in the UK I’ll take you down to the “Rub-A-Dub” for a “Ship Full Sail” or four, just have to make sure we grab a “Smash and Grab” for the ride home.Tongue

Thanks.

Regards

minesite
Quote Reply
Re: [minesite] Different content depending on static or dynamic pages. In reply to
Hi,

Glad it works :)

Re Amazon wishlist - I've made a quick one up here =) http://www.amazon.co.uk/...gistry/3F93PNDFAVT2S

Quote:
When I’m over in the UK I’ll take you down to the “Rub-A-Dub” for a “Ship Full Sail” or four, just have to make sure we grab a “Smash and Grab” for the ride home.Tongue

Laugh

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Different content depending on static or dynamic pages. In reply to
Andy

Intempo IDS-01b Speakers and Docking Station for iPod and Other MP3 Players - Black

On its way.

Thanks again.

Regards

minesite
Quote Reply
Re: [minesite] Different content depending on static or dynamic pages. In reply to
Oooh.. thanks <G> Cool

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!