Additional Options for Popular Tags Plugin

Creating and modifying plugins.
Post Reply
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Additional Options for Popular Tags Plugin

Post 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
Attachments
Archive.zip
Plugin and Strings
(4.87 KiB) Downloaded 302 times
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Additional Options for Popular Tags Plugin

Post 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
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Additional Options for Popular Tags Plugin

Post by Don Chambers »

Can we see where you have your modifications in use?
=Don=
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Additional Options for Popular Tags Plugin

Post 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
onli
Regular
Posts: 3044
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Additional Options for Popular Tags Plugin

Post 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.
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Additional Options for Popular Tags Plugin

Post by Don Chambers »

Daniel - I think Yellowled and Onli are giving you good advice.
=Don=
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Additional Options for Popular Tags Plugin

Post 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
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Additional Options for Popular Tags Plugin

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Additional Options for Popular Tags Plugin

Post by garvinhicking »

Hi!

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

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Additional Options for Popular Tags Plugin

Post 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
danst0
Regular
Posts: 197
Joined: Tue Jul 13, 2004 10:50 am

Re: Additional Options for Popular Tags Plugin

Post by danst0 »

Thanks! Then I am going with the css option.

Daniel
Post Reply