• I have a site with >50 pages. Almost every page has a unique sidebar created using text widgets which happen to contain links to other pages/files within the site. If a link changes (because of a path change, for example), each widget containing that link within the primary sidebar widget area must be manually adjusted! Is there any way to avoid this? Ideally, I would like to keep that link adjustment accessible to the (non-developer) administrative user (e.g., not buried in the functions.php file). Or am I stuck creating a long PHP switch block as a link shortcode (e.g., [link “products”])?

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

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi!

    One way I can think of would be creating a menu and use that menu with a custom menu widget instead of the text widget.

    Thread Starter msummers

    (@msummers)

    Jose – thanks for your reply! This is a good idea, but I don’t see how to implement it with my site. Those sidebars have text, images, and multiple blocks of links like this –

    text text text
    link
    link
    link
    image
    link
    text text

    etc.

    You can see the site at http://www.fielco.com. I’m thinking I may be stuck with my switch block, but I’m very open to other suggestions!

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    I see, I see. ( puts thinking hat on )

    A custom post type widget or even a custom text widget in which you extend it to show links? The user picks from a dropdown or puts in an ID for the page it would link to? Just sort of thinking out loud right now. 🙂

    Or better yet: https://wordpress.org/support/view/plugin-reviews/custom-menu-shortcode

    Create the custom menu and use the shortcode that way?

    Thread Starter msummers

    (@msummers)

    Thanks again, Jose! See, what I’m trying to avoid is what you try to avoid in a regular static site when you put your navigation into a server-side include. I don’t want to have to enter the same navigation path multiple times for multiple sidebar widgets.

    Using your method with custom post or custom text widgets, how would I embed the link widget within the content widget? Or am I not understanding what you are suggesting? I’d like to have something like –

    text text text
    {link set #1 }
    text text text
    {link set #5 }

    in a sidebar text widget.

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    What I was thinking was something like:

    -------
    textarea
    
    menu selection
    
    textarea
    
    menu selection
    --------

    In a way combine the two widgets into one. Or you could use the above plugin and use the shortcode in the text widget. The menu would be updated as well as the links without having to touch the text widget. 🙂

    Like I was saying, mostly thinking out loud. 🙂

    Thread Starter msummers

    (@msummers)

    Jose – sorry for the delay! This project has been pushed to a back burner, so I’ll re-consider when it bubbles up again.

    I think the way to do it is somewhat like you describe: just create link module shortcodes that can be used in any text widget placed in the sidebar. The trick will be to name the shortcodes so that they are easily recognizable!

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

The topic ‘Link preservation’ is closed to new replies.