Posts: 29
Threads: 9
Joined: Dec 2010
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
Posts: 1,108
Threads: 70
Joined: Aug 2009
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.
Posts: 29
Threads: 9
Joined: Dec 2010
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...
Posts: 2,928
Threads: 195
Joined: Feb 2011
can't you use just plain links to these pages?
Posts: 29
Threads: 9
Joined: Dec 2010
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
Posts: 3,491
Threads: 106
Joined: Mar 2010
@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
Posts: 29
Threads: 9
Joined: Dec 2010
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!