Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkingMode to highlight current selection #604

Open
sunnysideup opened this issue Feb 19, 2020 · 1 comment
Open

LinkingMode to highlight current selection #604

sunnysideup opened this issue Feb 19, 2020 · 1 comment

Comments

@sunnysideup
Copy link
Contributor

sunnysideup commented Feb 19, 2020

can we add this to blog object:

    function LinkingMode() : string
    {
        $request = Controller::curr()->getRequest();
        $test1 = $request->param('Action') && $request->param('Action') ===  $this->owner->getListUrlSegment();
        $test2 = $request->param('ID') && $request->param('ID') ===  $this->owner->generateURLSegment();

        return $test1 && $test2 ? 'current' : ($test1 ? 'section' : 'link');
    }

returns link in most cases, but if you are currently filtering for categories, it returns section for any blog category (or likewise for tags), and if you are currently filtering for a specific tag / category then it returns current

why we need this ...

Basically, on most SS blogs, you will have tags and you will categories. Blog entries s may show their associated cats / tags and there may also be a list of cats / tags on the landing page. When you click on any of these cats / tags, usually you get a filtered selection, based on the cats / tags selected. This is a part of the SS Blog. When you do end up on one of those "filtered" pages. They often look very similar to the unfiltered version. Highlighting the current filter may therefore just help the user understand where they are... here is an example:
image
I have clicked on developers. Nothing else much has changed on the page since the previous one (the blog landing page), but because "developers" is in red, the user can see she is on a subsection / filtered version of the blog.

@maxime-rainville
Copy link

Can you give a few examples of what the typical use case for this would be?

This would help us judge whether this is worth including in the code base or if it's something better left to individual developers to implement as extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants