Recent Topics

1 Jun 30, 2006 02:19    

In the template _main.php
I'd like to make make reference to the last part of the permalink.

The permalink is in the template as $Item->permalink()
this yields

http://mydomain/index.php/year/mo/dd/underbarredtitle


e.g.

http://thepessimist.ca/index.php/2006/06/27/fbi_pulls_the_trigger

I just want this last piece (e.g. fbi_pulls_the_trigger )

The closest I can get is $Item->title() , but that leaves in the spaces,
punctuation and excess length (e.g. 'FBI Pulls the trigger ...')

I can't seem to do any manipulation on these Item->Things() function things in the template. They just go straight through to the final html.

Does this underbarredtitle piece have a name that can be referenced in the template. I thought urltail was it, but various attempts to reference it only yielded blank.

2 Jun 30, 2006 02:40

Try

$Item->urltitle


Note that you'll have to do something if you want it to do something. Like for example

<?php echo 'the title without capitals or punctuation, and with spaces replaced by underscores is '.$Item->urltitle ?>

The second bit is untested. So is the first but I'm pretty sure it'll get you where you want to be.


Form is loading...