Forums

Modifying a theme to allow for Portals (4 posts)

  1. devc
    Member
    Posted 2 years ago #

    Hi guys,

    I've been using WordPress as a CMS for client websites for a while now, but recently have come across what I'm considering a unique request.

    The client would like to have a splash page and two options. Depending on the link you click you are directed into one of two Portals (A & B respectively)

    For the most part the only difference between Portal A & Portal B is the header footer, but in some cases, content will be unique to the respective Portal as well. The client would like to only have to edit one page if the content is identical between Portals.

    Can anyone suggest a flexible way to go about doing this?

    Here's what I've sorted out in my head. This may not be the most graceful solution but it might get creative juices flowing for some.

    I will be using "Templates" to determine the different layouts of the site. Let's go with a basic Splash for the initial choice of Portal page. OneColumn for a basic one column, full-width layout. TwoColumn for a two column layout.

    I plan on using PHP to append the current Portal to the navigation (?portal=a or ?portal=b), as well as determine what Portal has been passed. This will determine the header/footer to display.

    I cannot for the life of me think of a way to use cross-Portal content, unless otherwise specified. I'm trying to come up with some way of maybe using Blog Posts for Pages, and instead of Templates for layouts, using Categories. I would be able to have Categories for Portal specific pages too that way. The navigation might have to be hard-coded in which case I wouldn't need to worry about it?

    I'm just bouncing ideas around, I'm fairly weak with PHP and I know that someone else will have used WordPress for something similar. Any help is appreciated.

    Kind regards,

    D

  2. Mark / t31os
    Moderator
    Posted 2 years ago #

    Just to add a little input i think your cateogry idea is a good one, if you display different content based on the category requested your client would only need simply tag each post with the category that relates to the portal it should be shown on, if both, then he/she tags the post with both categories.

    I'm not sure appending the URL will get you all the way, you'd have an awful lot of URLs to account for, and i'd imagine you'd probably need to look at some URL rewriting to catch all cases.

    I thinking out loud here to, but maybe you could do this on a domain basis, using two subdomains..

    portalone.example.com
    portaltwo.example.com

    That way you could serve content based on the URL without having to check the query string.

    You could map requests to both domains back to a central domain with the WordPress install, and simply conditionalise the templates you serve onto the pages based on the requesting domain.

    It's just an idea though, i'd have no idea where you'd start with such a thing, it's simply a suggestion.

  3. devc
    Member
    Posted 2 years ago #

    Sorry, I should mention the client will not be blogging. This is a fairly static site but will need to be updatable by the client, which is why I'm using WordPress. In this sense I don't think there will ever be a huge number of pages, probably just the base 10 or 20 pages per Portal.

    The idea to use Posts is just so that I have access to Categories, perhaps I'll use the cat2page plugin and be able to do the same with Page's?

    If I end up hard-coding the navigation per portal, then there's really no need to specify what portal is allowed to view what, I just need to identify what Portal the user is in and display the appropriate Header/Footer, no?

    I've never used a PHP CONSTANT, but would that do the trick? And upon clicking the link to the other portal, I change the CONSTANT? Can anyone shed light on that? I'm off to read up about them...

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    Constants are as the name suggests, for information that remains constant, or unchanging..

    For variable data, you'd use variables, because the information is variable.

    The domain idea need not be complicated, i was simply saying that you could in essence control what data you serve on a page based on the domain requested, use one central installation, map two domains to that installation and conditionalise what you show based on the requested domain.

    The thing is, if you use a query string approach, like for example..

    example.net?portal=1
    and
    example.net?portal=2

    You only have that query string on the first request, and you'd need to start appending that query parameter to every link that follows. So if you're serving portal one, every link in portal one needs to also contain that same query string/parameter to maintain itself..

    It's only an idea though, and i'm more then happy to bounce around ideas with you here.

Topic Closed

This topic has been closed to new replies.

About this Topic