Suggestion: Menu Loop Switches

What would you like to see on Smack Jeeves? What are we doing well? Could we improve? Let us know!
Forum rules
Suggestions & Feedback Posting Guidelines
The purpose of this board is to allow community members to suggest new features or changes to be added to Smack Jeeves. Even if you aren't sure of a specific solution, but you recognize the need for an improvement, point it out!

Before Posting
Please browse/search the forum to make sure your suggestion hasn't already been made by someone else. If you find an idea similar to yours, post your contributing thoughts to that thread. Don't start a new thread unless your idea is significantly different from existing suggestions.


    1) Use a descriptive title when making a suggestion or pointing out the need for improvement.

    2) Describe the problem / solution in detail. First, explain why there is a problem or a need for a new feature to begin with. Then, describe your proposed solution (if you have one) clearly and effectively.

    3) Respect others' ideas. If you disagree with someone else's ideas or suggestions, respectfully and factually state why. While debate over different solutions is fine, insults or personal attacks will not be tolerated.

Sticky System
Suggestions that have been approved and chosen for implementation by the development team will be stickied. When development begins on an idea, that topic will be moved to the New Features & Changes in Progress board.

Suggestion: Menu Loop Switches

Postby nocturnenebula » May 10th, 2019, 11:57 pm

Suggestion: A "selected" and "unselected" switch for the menu loop like the news archive posts.
Reason: Readers will visibly know what page they're on as they click the internal links.
Challenges: it requires knowledge of HTML/CSS to style the selected link, otherwise it's just "there".
Notes: this is for page links the user is currently on, not styling the hover or active pseudo classes.

Don't know if it already exists or if it's been mentioned already in another post. The news archive has a selected and unselected loop for the news post links which I've found that in some of the templates but I haven't found one for menu links.

Example: the Classic template uses these switches to visibly show what page the user is on for the news posts.

Another thing: the loop switches for news posts aren't documented on the news archive variables.

How it looks in action:

As an example, readers click the "latest comic" page, the link is highlighted while the rest remain as is.
Lazy demonstration:
User avatar
Posts: 10
Joined: January 27th, 2015, 10:49 am
Location: Washington

Re: Suggestion: Menu Loop Switches

Postby eishiya » August 4th, 2019, 10:37 am

I think this would be more tidy if done the way comment replies are - just an extra variable within the current loops that's meant to be used as a class name for CSS styling.

So, for menus, there could be a {links.SELECTED_CLASS} variable that prints out "selected" when the current menu item is also the current page (and empty otherwise), so you can do something like
Code: Select all
<li class="{links.SELECTED_CLASS}">
   <a href="{links.URL}">{links.TEXT}</a>

and then use CSS to style the element differently from the others.

The same can be done with the news posts, just a {loop_posts.SELECTED_CLASS} variable :D So, your example code with this system would look something like
Code: Select all
<!-- BEGIN loop_posts -->
   <li class="post-item {loop_months.loop_posts.SELECTED_CLASS}">
      <a href="{loop_months.loop_posts.LINK}">{loop_months.loop_posts.TITLE}</a>
<!-- END loop_posts -->

Isn't that much cleaner and easier to follow?
User avatar
Posts: 9830
Joined: December 5th, 2009, 11:17 am

Return to Suggestions & Feedback

Who is online

Users browsing this forum: No registered users and 2 guests