« Return to Thread: Entry name before blog name in the title tag
shalini israni wrote:
:( i'm confused. I don't get what you're trying to do....
For individual entries if you want the $entry.getTitle() followed by
Blog name, you can use #BlogName() like you see in most of the head
files (for example asual-head.vm), after your $entry.getTitle()
You will have to do this in the entry files (for example
asual-entry.vm), since if you look at the theme.vm (for example
asual.vm) files, they already have this #foreach loop which iterates
thru the $BLOJSOM_ENTRIES..
Also, refer to http://wiki.blojsom.com/wiki/display/blojsom/Template+Macros
for a list of available stuff that you can use in your templates
(Page not loading at the time of writing this...but try it anyway)
--S
Arise wrote:
Thanks shalini. I've found a solution, but I don't know if this is the
best...
In my asual-head.vm I've placed this:
(formated for easy reading)
<title>
#set($count = 0)
#foreach($entry in $BLOJSOM_ENTRIES)
#set($count = $count + 1)
#if ($count == 1)
#set($name = $entry.getTitle())
#end
#end
#if ($count == 1 )
$name :
#end
#BlogName()</title>
but in the file is actualy like this, to get rid of the extra space:
<title>#set($count = 0)#foreach($entry in $BLOJSOM_ENTRIES)#set($count =
$count + 1)#if ($count == 1)#set($name = $entry.getTitle())#end#end#if
($count == 1)$name : #end#BlogName()</title>
shalini, in order to use $entry.getTitle() I had to use first
#foreach($entry in $BLOJSOM_ENTRIES).
Any advices to improve the code above? Or is this the right way?
In the code above I'm counting the number of entries, so in the main page
the Blog name comes first. In the individual entries I want the
entry.getTitle() followed by the Blog name.
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Pvt. Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infected mails.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Blojsom-users mailing list
Blojsom-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-users
« Return to Thread: Entry name before blog name in the title tag
| Free embeddable forum powered by Nabble | Forum Help |