Announcement

Collapse
No announcement yet.

Call a code

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 5th Jan '18, 11:06am.

  • #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 customization and demonstration site.
    vBulletin 5 Documentation - Updated every Friday. Report issues here.
    vBulletin 5 API - Full / Mobile
    Vote for your most annoying bugs.
    I am not currently available for vB Messenger Chats.

    Comment


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

      Comment

      Working...
      X