Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Name of the page
#1
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
Reply
#2
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.
My Github Repos: Github
Website: DigiMute
Reply
#3
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...
Reply
#4
can't you use just plain links to these pages?
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#5
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
Reply
#6
@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
Reply
#7
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!
Reply




Users browsing this thread: 1 Guest(s)