How to implement two pages in one plugin with separate content filtering (All, Mine, Friends) on each page?

I might have only not found the correct approach to built up pages with tabs where each tabs shows only the content specified by the filter. What I want to get (within the tidypics plugin) are two pages: albums and pictures - at least these two pages to be beginn with. On these two pages I want the albums or pictures respectively filtered ('All', 'Mine', 'Friends').

It appears to me that Elgg already offers the default filter_context necessary for the tabs to show up but the pagehandler mechanism seems to have some hard routes to the corresponding filtered pages (in case of tidypics: photos/all, photos/owner and photos/friends).

As I said I get the tabs to show on both the album and picture pages. But on both pages the links on the tabs lead to the same pagehandler route. How can I define the underlying links for the filter_context tabs for each page separately?

  • i'd have a look at teh start.php file, use other plugins as a reference

  • So far, I've not seen any other plugin that has something like this implemented. That's why I posted my question here...

  • your specs of the functionality is not very clear
    i have coded multiple extra tabs triggers many times
    in various different plugins here and there
    do you have a mockup & specs of your features
    and the functions to be trigerred ?

  • @Dhrup: my question is not about how to generally code a plugin to use tabs. I know about that as I've used tabs for example in the gifts, userpoints, ... plugins already. My question is about the 'filter_context' attribute used in several core plugins and also in the tidypics plugin. In the tidypics plugin the filter_context attribute is used for listing all site albums ('All' tabs), your own albums ('Mine' tab) and friends's albums ('Friends' tab).

    As I understand it right now you only need to include the filter_context attribute with the corresponding context as value when using for example elgg_view_layout() for creating the tabs. But it seems the underlying pages need to follow some name convention for the pagehandling to work, e.g. in the tidypics plugin the all tab is expecting the 'all' handler, the friends tab the 'friends' handler. This is fine if you only have one type of elements you want to get displayed, for example All/Mine/Friends albums. But if you want to use the same filter contexts for a second type of elements to be displayed (in case of tidypics All/Mine/Friends images) you have the problem that the page handling connects the tabs (=links of tab titles) automatically with the links to the already defined page handlers of the other list page (in this case albums).

  • geez it is quite hard to understand when you write so much; the important forest stuff gets kinda lost in the trees.


    what you seek
    cannot be done
    it was not designed to be that way
    without a fair lot of heavy code.


  • Yep. Not trivial. But using the 'filter_override' attribute I've made it to work at least a bit simplier than I was afraid of at the beginning - thanks Satheesh.