[Solved] How can I output the URL of a News story?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am

[Solved] How can I output the URL of a News story?

Post 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?
Last edited by stopsatgreen on Thu Nov 08, 2007 9:50 am, edited 1 time in total.
streever

Re: >:( How can I output the URL of a News story?

Post by streever »

Hi Stopsatgreen,

I am pretty sure that the "more" link is within the News template already, no? is that what you need?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: >:( How can I output the URL of a News story?

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: >:( How can I output the URL of a News story?

Post 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...
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am

Re: >:( How can I output the URL of a News story?

Post 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.
Post Reply

Return to “CMSMS Core”