Support Forum
all of the template tags defaults are defined in the appropriate php file where the code for that template tag is... so you will need to look at the code to see the defaults...
this will change over time as we get our codex better populated... we will have a codex page for each template tag including the defaults... just not there yet...
as a two man coding team and one guy helping out here and with themes and the codex, its going to take some time...
volunteers welcome!!
Visit Cruise Talk Central and Mr Papa's World
oh... and should add that not every template tag has the truncate... just titles... the breadcrumbs were not considered a title... so group name, forum name, topic name got the treatment...
Visit Cruise Talk Central and Mr Papa's World
OK Steve so why does my second truncate example not work in that case, it is for a topic title I believe, fine on the breadcrumbs though although to be fair if you do not have nested breadcrumbs you could end up with problems. Imagine languages with long words?
So that's what I am asking - where is the spRowIcon tag defined, which php file? I can't find it and I have tried, honest! If I understand you correctly the tags are not separated into individual php files yet but it is your intention to do so eventually. At the moment the tags are in various php files, probably where they were first utilised?
Can you tell me why the code does not work, or give me an example of how to pass the argument iconUnread=xxx.png?Is it because I need to find where the tag spRowIcon is defined and pass the argument(s) there?
Do I need to pass the argument for both icons like this with respect to syntax?
('tagClass=spRowIcon spLeft&icon=sp_TopicIcon.png&iconUnread=sp_TopicIcon_new_post.png');
or need I only pass the argument for iconUnread? Perhaps then in the absence of an unread post the default icon will be used?
I think a few more examples and I'll get it.
Sorry to be a pain.
The real problem is not having the documentation in place yet of course.
It's a shame that this thread has gone to a new page but I wil refer back best I can.
You said that truncate on sp_TopicIndexName did not work. I can not explain why as your syntax looks fine and it most assuredly does work on my site.
While using truncate in sp_BreadCrumbs will not currently work anyway you did actually use a $ instead of an & to separate the arguments which would have been incorrect. As it happens NOT adding support for this to the breadcrumbs was just an oversight on my part and I will add in support for that today.
Your use of iconUnread in sp_TopicIndexIcon again looks to be fine although my eyesight is not what it once was! Again this works perfectly for me on my test sites so if not for you I am unable to explain. I am assuming that the forum you tried it on did in fact have topics with unread posts!
Finally - you did reference the function sp_SubForumIndexIcon which again should be OK to use except again I missed this one and will correct that today. Sorry - put it down to the bout of flu I am still trying to shake off.
Right - today's lesson!
Every template function is defined with a set of default arguments. If no arguments are passed to the function when it is called, the defaults are automatically used. So - to take up your example - it is not necessary to pass the icon name 'sp_TopicIcon.png' - which is the default - unless you want to replace it with an icon of a different name. As it stands, I have defined the default 'iconUnread' to be the same as 'icon' (we may change that but have not decided yet). So, if you do want an unread icon to be used it IS necessary to pass this as an argument.
If you look at all the files in the 'templates' folder of a theme and concentrating on the base forum templates only, they are split into Group, Forum and Topic Views plus Head and Foot templates.
if you now look in the SP folder simple-press/forum/content you will find the template function code files. Group, Forum and Topic views are obvious. The Head and Fot function are in the 'common-view' file because these are used on all pages.
So - for an example - with no documentation in place, if you need to look at the default arguments for the template function sp_TopicIndexIcon - this appears in the spForumView template and the function itself is in the sp-forum-view-functions.php file. And where that function is defined you will find immediately the list if available arguments and their default values - all of which can be overridden when called by a template.
So endeth today's lesson. Explore away!
YELLOW
SWORDFISH
|
1 Guest(s)