Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator bcworkz

    (@bcworkz)

    Are you saying that you want the default permastruct to be sitename.com/%postname%/, but in some situations you want the permalink displayed to have a permastruct of sitrename.com/%category%/%postname%/? How would code know which permastruct is desired? If code can make that determination, you can use the ‘pre_post_link’ filter to alter the permastruct used to create a post’s permalink.

    As long as the post slug is the last permalink item, you can pretty much put anything you want in between. Even this would work: sitename.com/meaningless/information/%postname%/. However, you cannot place arbitrary numbers as permalink terms because WP will try to interpret them as a date parameter.

    Thread Starter nate.ads

    (@nateads)

    Very close to what I am looking for. But the permalink order would be reversed.
    sitename.com/%postname%/%custompost% I haven’t looked into the approach through the Permalink page as I didn’t know this was a possibility with the end target page being pre-made, but I will do some more research.

    The entire concept in the end would be for the Admin to have the ability to create small user microsites with access to custom post templates that are pre-made.

    So as an example I am making a microsite for bcworkz so I would ‘Add New’ under Posts and create the initial post sitename.com/bcworkz/ that would be the root page for the user with links to tutorial video pages (how to drywall, how to paint, how to install baseboards)

    This is where I get stumped, I want the pages ‘how to drywall, how to paint and how to install baseboards’ to run off this permalink structure
    sitename.com/bcworkz/how-to-drywall/
    sitename.com/bcworkz/how-to-paint/
    Without the need to duplicate the Posts for those video pages. My goal is to make it as simple for the Admin as possible by basically creating the first post which is the users name and then picking and choosing what video pages they have access too.

    I hope this makes more sense than my original explanation. My mind knows what I am looking for but explaining it is tricky.

    Moderator bcworkz

    (@bcworkz)

    If you ensure these custom posts are are in fact pages that are children of the user’s main page, you will get the permalinks you desire automatically without changing anything. There really isn’t much a page can’t do that a post can. Content is content, how it’s displayed depends on templates, not post type. You could create a custom hierarchical post type if using pages is an issue. The problem with regular posts is they are not hierarchical.

    You can even add code that creates the main user’s page when a user is added and assigned a particular role. A bit more code to ensure pages of users of that role all have that user’s main page as parent.

    Of course, the other thing you could do is create a multisite installation. Posts made in multisite, if the subdomain option is not used, have the default permalink for posts within a user’s “blog” as sitename.com/blog-name/post-name/. Naturally, these so called blogs can be anything besides blogs, just as WP can be anything besides a blog.

    Thread Starter nate.ads

    (@nateads)

    I was thinking of the multisite approach, but the admin wants something a little easier to work with as they aren’t too familiar with WordPress to the degree of adding sites to a multisite install. I think my end approach might have to be to use a page or post duplicator plugin to duplicate the child post pages for the video tutorials. And drop them into each respective user.

    In theory everything would be very easy if I only created 1 user and created their video tutorial pages, but I’m trying to work out something that can continue to be used going forward.
    e.g. bcworkz has a minisite that has 2 links
    sitename.com/bcworkz/how-to-drywall/
    sitename.com/bcworkz/how-to-paint/

    Then the admin adds a new user minisite for Rigby
    user root page
    sitename.com/rigby/

    The admin can then add what video tutorials Rigby has access too which would then be
    sitename.com/rigby/how-to-paint/
    sitename.com/rigby/how-to-ski/
    sitename.com/rigby/how-to-golf/

    Without affecting bcworkz minisite permalinks.

    Trick here is to have this work without duplicating the how to posts for each user, instead the posts would be pulled almost from a pool. I will talk to them and see if I can convince them to not be concerned about the tutorial permalinks structure, that would solve all the trouble I am having.

    I will look into hierarchical and child posts as that may solve my problem though. Thanks @bcworkz for the info, hopefully your suggestions will lead to a solution for me.

    Moderator bcworkz

    (@bcworkz)

    You’re welcome! You mentioned post duplicator, which makes me believe the intention is child pages with the same slug will actually have identical content. In your example, would /how-to-paint/ for both user bcworkz and rigby ideally be the same page? You apparently recognize that children with the same slug are in fact different pages.

    Post duplicator would be one solution, but in my mind, redundant data is a bad scheme to intentionally adopt. What if the site were to grow to many dozens of users accessing /how-to-paint/? Such inefficiency! Then what if that page needed to be updated? All those many dozens of pages would also need to be updated. Not good!

    Forgetting the desired permalink structure for a moment, it sounds to me like you will have a series of articles that should only be accessed by certain users. Am I right? Or does it matter if my user could access rigby’s /how-to-ski/ article? I think it would matter, yes?

    If so, honestly, having the user name in the permalink is redundant. You can do so if you want, but there is little point because users need to log in in order to manage access, so WP knows who is accessing what articles, it does not need to be repeated in the permalink. The best scheme would work either way.

    What is most important is to be able to easily specify which users can access which articles. The permalink structure is really secondary. I could cook up some scheme that allows this, but I suspect someone has already done so in the form of some sort of school management plugin. I cannot refer you to anything specific, but I encourage you to search for a plugin that would allow an admin to specify which users can access specific articles.

    Thread Starter nate.ads

    (@nateads)

    @bcworkz you hit the nail perfectly on the head.

    Everything you detailed above is the exact situation I am encountering.

    You bring up very valid points in regards to post access, future edits and amount of redundant data with duplicating the pages.

    I will try and push a bit for the client to not be hung up on the appearance of the permalink structure as I really would like to keep things as clean as possible.

    Thanks a bunch for the feedback and helping me sort through my options.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Dynamic Taxonomy and Permalinks’ is closed to new replies.