[tabular indent] Extended Comment Links Customization for "No Comments"

Oct 27, 2005 13:54


The following overrides allow you to have a custom phrase show up when there are no comments on an entry. These overrides are intended to be used with the Tabular Indent system style. If you use these overrides with any other style, they may cause your journal to display incorrectly, such as changing the location of your comment links.

You will have to use the following GLOBAL_HEAD override in order to allow for a customize phrase to show up when there are no comments and also to create custom comment link pluralizations. This GLOBAL_HEAD override sets up 5 classes that will be used to 'hide' certain text depending on the number of comments that are on an entry. Remember that you have to merge this override with any existing GLOBAL_HEAD overrides that you might have.

GLOBAL_HEAD<=

<=GLOBAL_HEAD
Each style has three sets of overrides, one for each of the three journal views. LASTN overrides affect the Recent Entries page, FRIENDS overrides affect the Friends page, and DAY overrides affect the Day page, which is accessible through the Calendar view. If you are not using the same style on all three of these views, then you may need to combine overrides from multiple tutorials in order to use the correct override for each combination of styles and views.

LASTN View:

LASTN_TALK_READLINK<=
c%%mc-plural-s%%
<=LASTN_TALK_READLINK

LASTN_TALK_LINKS<=

Comments: no one has spoken %%messagecount%% has spokenhave spoken - Leave a Comment

<=LASTN_TALK_LINKS
FRIENDS View:

FRIENDS_TALK_READLINK<=
c%%mc-plural-s%%
<=FRIENDS_TALK_READLINK

FRIENDS_TALK_LINKS<=

Comments: no one has spoken %%messagecount%% has spokenhave spoken - Leave a Comment

<=FRIENDS_TALK_LINKS
DAY View:

DAY_TALK_READLINK<=
c%%mc-plural-s%%
<=DAY_TALK_READLINK

DAY_TALK_LINKS<=

Comments: no one has spoken %%messagecount%% has spokenhave spoken - Leave a Comment

<=DAY_TALK_LINKS
  • Leave a Comment : word or phrase you want to use as a link to post a new comment

  • no one has spoken : word or phrase that will be displayed when there are no comments

  • has spoken : word or phrase that will be displayed when there is one comments

  • have spoken : word or phrase that will be displayed when there are more then one comments

  • - : what will be displayed between the comment links



You might look at the *_TALK_READLINK overrides and think that it's not possible for that to allow for a link to view the comments to be present. Well you are partly correct in thinking this way. The *_TALK_READLINK override itself does not produce any text that could be used to make a link. If you look at the *_TALK_LINKS overrides, you will notice that I have placed %%readlink%% into the class argument of the span tags. The %%readlink%% will be replaced by whatever is "produced" by the *_TALK_READLINK override. The *_TALK_READLINK overrides will "produce" either nothing, a 'c' or a 'cs' depending on the number of comments that are on the entry.
What is produced Reason it was produced nothing No comments on the entry 'c' One comment on the entry 'cs' More then one comment on the entry
Using what was produced by the *_TALK_READLINK, 12 different class can be produced.
Class Needed for... n This class is needed to view: no one has spoken when there are no comments. nc, ncs These classes are needed to hide: no one has spoken when there are comments v This class is needed to hide the link to read the comments when there are no comments to read vc, vcs These classes are needed to view the link to read the comments when there are comments to read s,scs These classes are needed to hide: has spoken when there is either no comments or more then one comment sc This classes is needed to view: has spoken when there is exactly one comment p,pc These classes are needed to hide: have spoken when there is either no comments or only one comment pcs This class is need to view: have spoken when there is more then one comment
This is where the 5 classes that were given the display: none; property in the GLOBAL_HEAD become important. In the table above you will notice that these 5 classes reference to when a class is needed to 'hide' certain text. You might notice that there is actual 7 classes that reference to when a class is needed to 'hide' text, the other 2 classes are the s and p class. we don't have to worry about hiding the s and p classes because the v class will "surround" these class and the result will be that this text will be hidden as well.
Variable References: Additional References:
Contributed by slice420.

comment links, custom "no comments" phrase, comment link text, - tabular indent

Previous post Next post
Up