Call a code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gota
    New Member
    • Jan 2018
    • 14
    • 5.3.x

    Call a code

    So, what I want to do is pretty simple but a bit hard to explain. We will have a Worldbuilding area that is made up of multiple custom pages (like, over a hundred) and each of them should have a container to the left that copies the same code (the index, so you can easily jump from page to page) - this is how it looked like on our old site which we moved away from http://essence-of-horhsal.boards.net/page/worldbuilding (I couldn't figure it out there as well). Like, instead of putting the whole code into the container you call upon the code that is stored elsewhere so that you have to edit the index only once if you add new stuff (which we will do a lot) instead of having to edit it into every single page (which would be over 100 - and you can imagine that's WAY too much of a hassle).
    In simpler: store a code somewhere which you can call into, for example, a static HTML container and make it so as if said container is using the code. Or is there a simpler solution?

    Edit: I see that templates could be a solution but how would I make it that, if I use narrow/wide, the narrow modules are the same for each page using the template while the wide ones are different per page?
    Last edited by Gota; Fri 5 Jan '18, 10:06am.
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 73981

    #2
    There are two ways to do this...

    1) You can use a PHP Module and use PHP's include or require functions to load an external file that has the HTML for your menu.
    2) You can use a Static HTML Module to include it. This can include a Javascript file to be used in building the menu.

    It depends on your level of coding experience. You may be able to contract this out on https://vbmods.rock though. He may be able to use a custom module that pulls from a template you modify in the AdminCP.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • Gota
      New Member
      • Jan 2018
      • 14
      • 5.3.x

      #3
      Nevermind, I solved it by adding a wiki to our webspace. Still thanks for the help.
      Last edited by Gota; Sat 6 Jan '18, 10:05am.

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...