Customizing SMF > Graphics and Templates

[Post.template] Add another toggable container.

(1/1)

Baiulus:
Hi there  :)
I'm trying to add one more "Attachments and other options" - like container into new post template.
I did all I could, but whatever expand link I click both containers are being expanded, collapsing works the same way.

Here is added html:

--- Code: ---<div id="postPictureHeader">
<img src="', $settings['images_url'], '/expand.gif" alt="+" id="postPictureExpand" style="cursor: pointer" title="+" /> <strong><a href="#" id="postPictureExpandLink">', $txt['post_additionalopt'], '</a></strong>
</div>'
<div id="postPicture" class="smalltext">
--
</div>';
--- End code ---
And js:

--- Code: ---var oSwapAdditionalOptions = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ',
funcOnBeforeCollapse: function () {
document.getElementById(\'additional_options\').value = \'0\';
},
funcOnBeforeExpand: function () {
document.getElementById(\'additional_options\').value = \'1\';
},
aSwappableContainers: [
\'postMoreOptions\',
\'postAttachment\',
\'postAttachment2\',
\'postAttachment3\',
\'postPicture\'
],
aSwapImages: [
{
sId: \'postMoreExpand\',
srcExpanded: smf_images_url + \'/collapse.gif\',
altExpanded: \'-\',
srcCollapsed: smf_images_url + \'/expand.gif\',
altCollapsed: \'+\'
},
{
sId: \'postPictureExpand\',
srcExpanded: smf_images_url + \'/collapse.gif\',
altExpanded: \'-\',
srcCollapsed: smf_images_url + \'/expand.gif\',
altCollapsed: \'+\'
}
],
aSwapLinks: [
{
sId: \'postMoreExpandLink\',
msgExpanded: ', JavaScriptEscape($txt['post_additionalopt']), ',
msgCollapsed: ', JavaScriptEscape($txt['post_additionalopt']), '
},
{
sId: \'postPictureExpandLink\',
msgExpanded: ', JavaScriptEscape($txt['post_additionalopt']), ',
msgCollapsed: ', JavaScriptEscape($txt['post_additionalopt']), '
}
]
});
--- End code ---
I really can't figure it out. Thanks in advance for all help.

Navigation

[0] Message Index

Go to full version