Page 1 of 1

Additional Options for Popular Tags Plugin

Posted: Sun Nov 28, 2010 4:48 pm
by danst0
Hi,

I just added two options to the popular tags plugin.
1) Some themes show lists with little spaces between them, so I added an option to put a <br /> behind every list item
2) I don't want to see the number of commentors in brackets -> additional option to leave that out

Would anyone be interested in reviewing them and putting them into spartacus?

Daniel

Re: Additional Options for Popular Tags Plugin

Posted: Sun Nov 28, 2010 6:58 pm
by yellowled
danst0 wrote:1) Some themes show lists with little spaces between them, so I added an option to put a <br /> behind every list item
If it's an actual list item, i.e.

Code: Select all

<ul>
<li>...</li>
<li>...</li>
</ul>
putting a <br /> behind it is not only unnecessary, but also (at least I think so) invalid markup.

YL

Re: Additional Options for Popular Tags Plugin

Posted: Sun Nov 28, 2010 7:04 pm
by Don Chambers
Can we see where you have your modifications in use?

Re: Additional Options for Popular Tags Plugin

Posted: Mon Nov 29, 2010 6:12 am
by danst0
Hi,

@yellowled, the alternative to the br is to change the style sheet of the class plainlist, which I do not want to, the list looks good if each list item is only one line long, it looks messy if it is more than one line per item.

http://scrmblog.com/

Daniel

Re: Additional Options for Popular Tags Plugin

Posted: Mon Nov 29, 2010 6:22 pm
by onli
>the alternative to the br is to change the style sheet of the class plainlist
That's not the only option. One could also select the list via the parent-class serendipitySideBarItem container_serendipity_plugin_POPULARENTRIES. Inserting br for pure markup is not a proper solution.

Re: Additional Options for Popular Tags Plugin

Posted: Mon Nov 29, 2010 11:22 pm
by Don Chambers
Daniel - I think Yellowled and Onli are giving you good advice.

Re: Additional Options for Popular Tags Plugin

Posted: Tue Nov 30, 2010 7:07 am
by danst0
Hi,

thanks for the hints! I am not an expert in css so it took some time to figure it out, and I realized that my stylesheet did not even contain a plainList class, but then I came across your post (http://matthias.yellowled.de/archives/1 ... n-s9y.html) and included it.

After some fiddling I added the following to change the distance between list items.

.container_serendipity_plugin_POPULARENTRIES.serendipitySideBarItem li {
margin-bottom: 1em;
}

As written above I also added an option to the plugin to remove the number of visits for each entry could you please comment on that?

In php it looks like that:
if ($show_number == 'yes') {
echo ' <span class="serendipitySideBarDate">(' . (!empty($entry['points']) ? htmlspecialchars($entry['points']) : 0) . ')</span>'; }

So I only added the if statement. If this is ok for you I would remove the br from the code and put the new version here (or what is the usual submission process)?

Daniel

Re: Additional Options for Popular Tags Plugin

Posted: Tue Nov 30, 2010 12:55 pm
by yellowled
danst0 wrote:In php it looks like that:
if ($show_number == 'yes') {
echo ' <span class="serendipitySideBarDate">(' . (!empty($entry['points']) ? htmlspecialchars($entry['points']) : 0) . ')</span>'; }

So I only added the if statement. If this is ok for you I would remove the br from the code and put the new version here (or what is the usual submission process)?
Seems fine tome me, but I am not a PHP coder at all. :)

I guess the usual submission process actually is to post something (preferably a so-called diff, if you can do that; it's fine if you can't) here and let Garvin have a look at it. Should you produce submissions on a regular basis, you'll probably get an account for the S9y code repositories.

YL

Re: Additional Options for Popular Tags Plugin

Posted: Tue Nov 30, 2010 12:57 pm
by garvinhicking
Hi!

Also, you could hide the archiveDate-Stuff with CSS display:none as well?

Regards,
Garvin

Re: Additional Options for Popular Tags Plugin

Posted: Tue Nov 30, 2010 1:28 pm
by yellowled
garvinhicking wrote:Also, you could hide the archiveDate-Stuff with CSS display:none as well?
Not display: none; but

Code: Select all

[selector] {
    position: absolute;
    left: -9999em;
}
display: none; also hides it from screenreaders and maybe search engine robots, this technique doesn't.

YL

Re: Additional Options for Popular Tags Plugin

Posted: Tue Nov 30, 2010 3:17 pm
by danst0
Thanks! Then I am going with the css option.

Daniel