Feature #7493
Make [-]/[+] toggle configurable
100%
Description
[was 0013694 on bugs.typo3.org]
In archive and category menu the [+]/[-] links to toggle the content are hard coded in the archive/category widget class so they cannot be replaced by icons. In order to make a stylish blog it would be nice to have this configurable, i.e. by typoscript config.
Updated by Lorenz Ulrich over 10 years ago
Dmitry Dulepov's response:
I fully agree with you: it would be best to switch CSS classes, for example. It should work in most browsers with "content" css property (msie8 requires DOCTYPE). Now the problem is: how do we make it compatible with previous versions?
Probably code should changed to something like:
<span id="toggle5" class="node-open"><span>[+]</span></span>
Then JS can be:
if($(\'toggle'. $id. '\').firstChild.nodeValue == "[+]") {
$(\'toggle'. $id. '\').innerHTML = "[-]";
$(\'toggle'. $id. '\').class = "node-closed";
} else {
$(\'toggle'.$id.'\').firstChild.nodeValue = "[+]";
$(\'toggle'. $id. '\').class = "node-open";
}
What do you think?
Updated by Lorenz Ulrich over 10 years ago
Lorenz Ulrich's reply:
CSS classes would be best, I agree. I tried to test it in my blog but I failed. I found out that "className" would be the correct function (can you confirm?) but using
$(\'toggle'.$id.'\').firstChild.className = "node-open";
nothing happens. Tiny detail: node-close would be better than node-closed as it describes the action, not the result.
As for the backwards compatibility, I agree that a separate <span> would be good. But in the archive widget we then have more than one <span> (the new one and the span to wrap the post count) so I would give it an own class name, i.e. <span class="togglelink">.
Updated by Lorenz Ulrich over 10 years ago
Dmitry Dulepov's reply:
I tried too and failed too :) I think I?l have to rework the code in that class: extract all inline JS to functions and call those functions.
It will take some time to fix but I on it :)
Updated by Dmitry Dulepov over 10 years ago
Revision 38352 allows to set custom markup for archive view. I went for markup in order to preserve compatibility.
Code example:
plugin.tx_t3blog_pi1 { archive { toggle { open = [+] close = [-] } catLink.10.value < plugin.tx_t3blog_pi1.archive.toggle.close } }
Updated by Dmitry Dulepov over 10 years ago
- Status changed from New to Accepted
- % Done changed from 0 to 20
Updated by Dmitry Dulepov over 10 years ago
- Status changed from Accepted to Resolved
- % Done changed from 20 to 100
Applied in changeset r38352, r38409.