GetSimple Support Forum

Full Version: Name of the page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I apologize if I'm boring, but I do not know php language...

Is there a way to obtain the name of the file via php?

For example:

Page name: The house
Real name of the file: the-house.xlm

I need find the page name (without extension) for use it in a link and download a different file, for example, the-house.pdf

Thankyou
In your theme files $id will return the slug name

so

Code:
echo $id.'.php'; // the xml file
echo $id.'.pdf'; // a pdf file of the same name.
n00dles101 Wrote:In your theme files $id will return the slug name

so

Code:
echo $id.'.php'; // the xml file
echo $id.'.pdf'; // a pdf file of the same name.

Yes, correct...but how include this code in a page? If I manage it in a component the result is the name of the component...
can't you use just plain links to these pages?
Connie Wrote:can't you use just plain links to these pages?

Yes, it is a way but I need to implement a routine that will be the same for every page...but in every page this routine download a different file.

Thanks
@Bak

In your template or component:
Code:
<?php get_page_slug(); ?>.pdf
or:
Code:
<?php echo return_page_slug(),'.pdf'; ?>

Full list of GetSimple template tags: http://get-simple.info/wiki/themes:template_tags
Carlos Wrote:@Bak

In your template or component:
Code:
<?php get_page_slug(); ?>.pdf
or:
Code:
<?php echo return_page_slug(),'.pdf'; ?>

Full list of GetSimple template tags: http://get-simple.info/wiki/themes:template_tags

Thankyou so much....perfect!