2 users online. Create an account or sign in to join them.Users
This is an open discussion with 13 replies, filed under XSLT.
Now that the Section Schemas extension outputs all tags from a section and their frequency, we can build a weighted tag cloud.
This template assumes the following:
Call the tag-cloud template passing the XPath reference to the options of the taglist. The range parameter is used to create class names so that you can style the tags differently (in size, weight, colour etc.). In the example above, a range of 5 is provided, so the class attribute values will be one of: size-1, size-2, size-3, size-4 and size-5 depending on how frequently the tag has been used (the least used will be size-1, the most used size-5, and everything else evened out inbetween). To create more variety, increase the range.
Note that the template requires the math:max() function provided by EXSLT, hence I've included the namespace at the top.
I'm really new to the section schema thingy but your extension seems promising. although I tried to make it work but nothing happens so far. I've installed your section-schema extension first and created a section scheme ds for my articles section, that's where my taglist is to be found.
in my template I used <xsl:import href="../utilities/tag-cloud.xsl"/> to include your utility. all works fine. I guess. because nothing happens at all. section-schema ds shows up in my debug. utility is loaded but nothing comes out :(
I changed the param tags according to my article-sections name:
<xsl:with-param name="tags" select="section-schema[@handle='artikel']/*[name()='tags']//options"/>
The actual tags are located in the DS slider-content:
<section id="6" handle="artikel">Artikel</section>
<entry id="120" comments="0" images="0">
<item handle="agentur" id="116">category</item>
<date time="17:12" weekday="4">2009-04-16</date>
Any hint for me to get things working?
Hi maik, could you post your full page XML and XSLT please? Pop them onto pastie.org so I can get a better picture of your problem.
sorry, I got hung up on some other projects the last days. Right now I’m back on my Project. You’re saying that the section schema should output all used tags and their frequency?! Seems like mine is missing that information:
Is this pasty-paste part of a symphony pasty import utility template, or rather a service by pastie? I think I have seen it before somewhere else recently.
@mwaidmann seems like you’re using an older version of the Section Schemas extension. v1.2 fixed a problem with selects and tags, and also added sortorder and location attributes for each field.
Yeah :) Thanks for your help nick.
This is a great template.
I have one minor suggestion. Since tag list fields can be sourced in other sections, and the section schema lists both used and unused tags, it helps to append [@count > 0] at the end of the tags parameter select to cull links with empty results.
Decreased fruitless clicking increases world peace. :)
Hi, i have following error:
Parse error: syntax error, unexpected '<', expecting ')' in /htdocs/workspace/data-sources/data.section_schema_articles.php on line 18
After saving Section Schema^^
Sections schemas: 1.7
What i'am doing wrong?
Can you attach the file?
My hunch is that when the PHP file was created by the extension it left some additional characters in the body.
I clone version 1.7.1 from github, and it's work well.
Running into this error when using Section Schema with a Tag List:
Fatal error: Call to a member function fetchCol() on a non-object in /Users/lbradford/Sites/Internal/symphony-2/extensions/section_schemas/data-sources/datasource.section_schema.php on line 252
Ahhah! Someone has come before me:
Mark that as resolved.
Create an account or sign in to comment.
Contact the team
Symphony • Open Source XSLT CMS