Is it possible to use TvTagCloud to show a list of links for the tags of ONE page ?
Currently you can only specify a parent and all child documents will be used. You would have to modify the code, which I do not have with me atm. to get a single page.
I’d like to suggest an amendment to the code.
The current snippet does not trim whitespace around individual tags - so if a document author puts in tags such as:
Doc 1: tag1, tag2, tag3
Doc 2: tag2, tag3
the snippet will treat tag2 and <space>tag2 as separate items, which since multiple spaces don’t show in HTML gives an output of:
tag1 tag2 tag2 tag3
This is easily fixed by adding:
$array_content = array_map("trim", $array_content);
after
$array_content = explode($tagDelim, $content); //split them in separate words
Author:
ManagerManager plugin - customise your ModX manager interface
Rckt - web development, Sheffield, UK
I was hoping that this would handle child folders, but it doesn’t appear too.
I tried creating containers for 2006 and 2007 and moved documents inside the respective folders.
But now all that shows up on my main page where the call is made is this: (1) with no tags listed.
|
Identity Developments delivers SEO focused web design and web presence services
- it's not about websites, it's about your identity. |
Kyle,
thanks for the code. I switched the code as recommended...
It doesn’t appear to work unfortunately. Although, it doesn’t seem to break anything either.
I tried moving one of the docs, and the count for that tag decreased by one.
Then I thought that maybe it was because the container it was in was unpublished, but that didn’t have any effect, other than the container itself showing up in my ditto call, so that wouldn’t work even if it did work.
Open to any other suggestions.
|
Identity Developments delivers SEO focused web design and web presence services
- it's not about websites, it's about your identity. |
Had to modify (thanks ApoXX for the direction) my snippet installation to work with SEO Strict URLs because the tag parameter was being passed with an "&" instead of "?"
Here is the section of code (at the end of the snippet) with the changes and I’ve commented out and left the 2 original lines.
foreach ($words as $key => $value) {
if ($showCount) {
$countvalues = '(' . $value . ')';
}
if ($displayType == 'cloud') {
// $output .= '<span><a class="' . $styles[$wordStyles[$key]] . '" href="[~' . $landing . '~]&tags=' . $key . '">' . $key . $countvalues . '</a></span>';
$output .= '<span><a class="' . $styles[$wordStyles[$key]] . '" href="[~' . $landing . '~]?tags=' . $key . '">' . $key . $countvalues . '</a></span>';
$output .= "\r\n";
} else {
// $output .= '<li><a href="[~' . $landing . '~]&tags=' . $key . '">' . $key . ' ' . $countvalues . '</a></li>';
$output .= '<li><a href="[~' . $landing . '~]?tags=' . $key . '">' . $key . ' ' . $countvalues . '</a></li>';
$output .= "\r\n";
}
}
|
Identity Developments delivers SEO focused web design and web presence services
- it's not about websites, it's about your identity. |