* toshudhiman Sir,
U gave me the script of Showing the path of a site.
Which is given below.

<!--parser:xtscript-->
/* INITIALIZE VARS */
var $path= <xt:url type="path" />/
var $offset=0
var $len=call strlen $val=$path
var $button_class= xt_button xt_text small
var $button_style= padding:0 1px !important;margin:01px !important
/* HOME LINK*/
print <a href="/"><span class="$button_class" style="$button_style">home</span></a>
/* MAIN LOOP START*/
@loop
var $strt = call strpos $haystack=$path;$needle=/;$offset=$offset
var $end= call strpos $haystack=$path;$needle=/;$offset=($strt 1)
var $link=call substr $val=$path;$start=0;$length=$end
var $linktext=call substr $val=$path;$start=($strt 1);$length=($end-$strt-1)
/* EXIT IF INDEX FILE */
if $linktext == index
goto @end
endif
/* LINKS */
print <span class="$button_class" style="$button_style">&raquo;</span><a href="$link"><span class="$button_class" style="$button_style">$linktext</span></a>
/* MAIN LOOP END */
var $offset=($strt 1)
if $end < ($len-1)
goto @loop
endif
/* END */
@end
<!--/parser:xtscript-->

sir this script shows the file path ,which we had created in file browser,

but sir i want a script which shows a page title as path. Which we put by going to options of a page.
2014-06-05 06:18 · (0)
* Graham * toshudhiman to set the path as the title put <xt:url type="path" /> in the title setting
2014-06-05 07:04 · (0)
* toshudhiman * Graham Can u plz give me the whole script.
2014-06-05 07:24 · (0)
* Graham * toshudhiman I just tested and there is the potential that the editor could convert the " quotes " to entities
so you could use
<!--parser:xtscript-->
var $path=<xt:url type="path" />
<!--/parser:xtscript-->

Copy code

in the _header _footer or _headtags
and {_$$path|} in existing pages title setting and the site option setting for new pages

Or if you already have loads of pages then you could use a bit of javascript in the _header _footer or _headtags
<script type="text/javascript">
document.getElementsByTagName("title")[0].textContent='<xt:url type="path" />';
</script>

Copy code

Which would do all pages

Or this version which looks better because it trims off the leading / and replaces all other / with -
<script type="text/javascript">
  document.getElementsByTagName("title")[0].textContent=('<xt:url type="path" />'.substr(1).replace((new RegExp('/','g')),' - '));
</script>

Copy code
2014-06-05 08:34 (edited 2014-06-05 11:23 by Graham ) · (0)

Online: Guests: 1