/* add to extra.css, rename appropriately */
.signature { display: inline; }
.sigToggle { display: none; }
/* .. */
/* .. whatever the signature code is, class="baseHtml signature ugc sigToggle", rename accordingly .. */
<div class="baseHtml signature ugc sigToggle">... my $signature .. (click to hide)</div>
<script>
/* if xenforo uses div or span replace p with div or span
i think it is: <div class="baseHtml signature ugc"> */
$("div").click(function () {
$(this).toggleClass("sigToggle");
});
</script>
Wow Floris, I truly appreciate that.XenForo uses jQuery now, it shouldn't be too hard to tell it with js+cookie to collapse auto, or the other way around, until clicked, and update cookie if it needs to be remembered.
.toggleClass() api can be used perhaps; http://api.jquery.com/toggleClass/
Code:/* add to extra.css, rename appropriately */ .signature { display: inline; } .sigToggle { display: none; } /* .. */ /* .. whatever the signature code is, class="baseHtml signature ugc sigToggle", rename accordingly .. */ <div class="baseHtml signature ugc sigToggle">... my $signature .. (click to hide)</div> <script> /* if xenforo uses div or span replace p with div or span i think it is: <div class="baseHtml signature ugc"> */ $("div").click(function () { $(this).toggleClass("sigToggle"); }); </script>
.signature { display: inline; }
.sigToggle { display: none; }
<xen:if is="{$visitor.content_show_signature} && {$message.signature}">
<div class="baseHtml signature ugc"><aside>{xen:raw $message.signatureHtml}</aside></div>
</xen:if>
<xen:if is="{$visitor.content_show_signature} && {$message.signature}">
<div class="baseHtml signature ugc sigToggle"><aside>{xen:raw $message.signatureHtml}</aside></div>
<script>
$("div").click(function () {
$(this).toggleClass("sigToggle");
});
</script>
</xen:if>
The sigs didn't show at all.It sounds like we are on the right path. I have not tested it, nor do I know this is the right approach.
But yeah, it is worth a test. I am sure Miko or Erik or others with more jQuery experience (with xenforo) than me know if this is going right or wrong.
The javascript probably should be in a header somewhere, or at least just once on the page, not for every signature. script only needs to be loaded once. perhaps put it in the footer or something.
lol sounds like your half way there.The sigs didn't show at all.
<xen:if is="{$visitor.content_show_signature} && {$message.signature}">
<div class="baseHtml signature ugc{xen:if $message.isIgnored, ' ignored'}"><aside>{xen:raw $message.signatureHtml}</aside></div>
</xen:if>
<xen:if is="{$visitor.content_show_signature} && {$message.signature}">
<dl class="signature">
<dt>
<a onclick="jQuery(this).parents('.signature').find('.showsig').toggle('slow'); return false;" href="#">{xen:phrase showhidesig}</a>
</dt>
<dd>
<div class="showsig baseHtml ugc{xen:if $message.isIgnored, ' ignored'}" style="display: none; padding: 5px;"><aside>{xen:raw $message.signatureHtml}</aside></div>
</dd>
</dl>
</xen:if>
couldn't find anything--can you see if you can investigate more?The proper way to do this would be much simpler than described here. XenForo extends jQuery animation classes and you can use them to make the same effect as when you drop down the thread display options. Look at the code for them and duplicate for your needs... if you can't I'll write up some stuff to help when I have a chance.
maybe someone can use it, it's a simple toggle to show/hide sigs on post base.
find template: message:
Code:<xen:if is="{$visitor.content_show_signature} && {$message.signature}"> <div class="baseHtml signature ugc{xen:if $message.isIgnored, ' ignored'}"><aside>{xen:raw $message.signatureHtml}</aside></div> </xen:if>
and replace it with:
Code:<xen:if is="{$visitor.content_show_signature} && {$message.signature}"> <dl class="signature"> <dt> <a onclick="jQuery(this).parents('.signature').find('.showsig').toggle('slow'); return false;" href="#">{xen:phrase showhidesig}</a> </dt> <dd> <div class="showsig baseHtml ugc{xen:if $message.isIgnored, ' ignored'}" style="display: none; padding: 5px;"><aside>{xen:raw $message.signatureHtml}</aside></div> </dd> </dl> </xen:if>
finally create a phrase for 'showhidesig'
This worked a treat on 1.5 - Looking to upgrade to 2.1 - Would this still work?
No, anything written for XF1 will not work on XF2, it would have to be rewritten with the correct syntax and new code.
We use essential cookies to make this site work, and optional cookies to enhance your experience.