Page 1 of 1
[Solved] How can I output the URL of a News story?
Posted: Thu Nov 08, 2007 1:38 am
by stopsatgreen
Pardon me if this seems brusque, but I'm fed up of poorly-documented modules (or badly organised information). All I want to know is what variables are available for the News module, and after 45 minutes of searching I can't find anything. You would think the help file would have that information, but it seems that's too obvious.
Is there a variable to output the current URL, ie {$entry->url}? I need to get the current URL of a News story to include in a script. Please, can somebody help me?
Re: >:( How can I output the URL of a News story?
Posted: Thu Nov 08, 2007 2:46 am
by streever
Hi Stopsatgreen,
I am pretty sure that the "more" link is within the News template already, no? is that what you need?
Re: >:( How can I output the URL of a News story?
Posted: Thu Nov 08, 2007 3:37 am
by calguy1000
uhm.... if you want the URL of a specific news story, just browse to that news story, and 'copy' the url from the navigation bar..... then you can navigate to that story all you want.
Re: >:( How can I output the URL of a News story?
Posted: Thu Nov 08, 2007 4:48 am
by kermit
$self_url = sprintf('http%s://%s%s',
(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == TRUE ? 's': ''),
$_SERVER['HTTP_HOST'],
$_SERVER['REQUEST_URI']
);
echo $self_url;
is what i use (a UDT) to get the page URL to display in the footer of printed pages. i don't think there's a specific variable you can use...
Re: >:( How can I output the URL of a News story?
Posted: Thu Nov 08, 2007 9:49 am
by stopsatgreen
@kermit: That's just what I need, thanks very much.
My point still stands about poor documentation; News is on version 2.6 already, and very few of the variables are listed anywhere. They should list them beneath the new template creation field, as Cataloger does, or at least in the Help file.
Still, I have what I needed so I'll mark this as solved.