FANDOM


  • I think it would be particularly good if infoboxes of the same "class" were linked. For example, if I have an infobox, e.g. Infobox_episode or infobox_books, it would be nice if there was a particular group that simply collected all this information and presented it as a navigation, as shown below:

    <!-- Infobox on page stargate-->
    {{infobox books|name=Stargate|published=1999|author=MacGuyver}}
    
    <!-- Infobox on page MacGuyver-->
    {{infobox books|name=MacGuyver|published=1995|author=Mr fixit}}

    A sample infobox could be generated using:

    <infobox>
    <data source="name"/>
    <data source="author"/>
    <data source="published"/>
    <group type="classlinks" header="Available books"/>
    </infobox>

    There could be options to customize classlinks. This can currently be done by using javascript or lua or regular templates. But it requires dpl or hardcoding of all data.

    Edit:Made some changes.

      Loading editor
    • I'm a bit confused by this example.

      1. Is "publisher" a typo of "published"?
      2. Are the infobox_books on the same page, or different pages?
      3. How are they linked to the classlinks group?

      I think a horizontal group is a bad choice for an arbitrary number of books, if I'm understanding the intent here.

        Loading editor
    • Moviesign wrote:
      I'm a bit confused by this example.
      1. Is "publisher" a typo of "published"?
      2. Are the infobox_books on the same page, or different pages?
      3. How are they linked to the classlinks group?

      I think a horizontal group is a bad choice for an arbitrary number of books, if I'm understanding the intent here.

      I've edited my opening post:

      1. Indeed it was a typo
      2. On different pages
      3. Classlink group is just a generic group that for my example collects pagenames(and their links) from all portable infoboxes using the same template.

      It is a simple navigation kind of thing. Like for example in this page (http://stargate.wikia.com/wiki/1969_(episode)) .

      The section of the infobox covering "chronology", "preceeded by" and "followed by".

      Of course using groups you could have any number of pages you wish or use the vertical layout if there's a need for it.

      As far as I can tell the api already determines this information automatically, e.g. (http://infoboxpreview.appspot.com/).

        Loading editor
    • Interesting. There is quite a bit of Javascript behind that example to make it work. That infobox preview is very similar to what I was trying to accomplish (but could never get to work completely) with this (you may recall from "the long thread"). DPL fails to provide all the info in a format that the new infoboxes can handle. The developers did say that they had a DPL-like functionality in the works. I'm hoping we'll see it in the first quarter of 2016, but I'm not holding my breath.

        Loading editor
    • Yes, I always find myself wanting to use content from infoboxes using the same template. I know how to design it to work with javascript and even lua. But adding javascript to an infobox is a particularly awful hack,  I'm too lazy to hardcode it, and DPL isn't a particularly attractive solution. 

      So I generally just leave it as is. But implementing this on the server side would be excellent and they can cache the results, so it hopefully won't be very expensive.

        Loading editor
    • DPL works pretty good if you don't ask it to transfer <ref> tags and such to the new infoboxes. I could try to write the DPL function for you, if you want to try it out. It would be a fun challenge.

        Loading editor
    • Moviesign wrote:
      DPL works pretty good if you don't ask it to transfer <ref> tags and such to the new infoboxes. I could try to write the DPL function for you, if you want to try it out. It would be a fun challenge.

      Well, I don't have dpl activated in my home wikia, partly because of the staff's stern warning, and partly because it seems like it will be eventually be deprecated.

      Anyway, if you're interested in a challenge, you can try writing one for w:c:dev:Template:Infobox_Lua.

      Basically, a simple link to one or two other lua module documentation pages within the same category would be nice. The infobox automatically categorizes meta-modules or global modules (although they haven't all been updated properly yet), so it would be great if the infobox automatically listed other infoboxes in the same category.

        Loading editor
    • There ya go. Let me know if you have any problems or need clarification or modification. I hope it meets your needs.

        Loading editor
    • Moviesign wrote:
      There ya go. Let me know if you have any problems or need clarification or modification. I hope it meets your needs.

      Great, it looks really good. That will automatically surface other similar templates. But doesn't its random nature imply that it might be possible for it to show the same page twice?

        Loading editor
    • On subsequent calls yes, but not from a single call. It fetches all of them and then picks two without replacement.

        Loading editor
    • I suppose it also excludes the current page. Anyway, thanks for the improvement. It was just like I envisioned it.:)

        Loading editor
    • I wouldn't bet on that, but I really don't know for sure. I'm glad you like it :) EDIT: on further research, DPL queries do leave out the page that contain the query by default.

        Loading editor
    • Moviesign wrote:
      I wouldn't bet on that, but I really don't know for sure. I'm glad you like it :)

      EDIT: on further research, DPL queries do leave out the page that contain the query by default.

      Great, it would be odd to link to the same page. 

      Anyway, thanks again. I owe you one, if you ever need help with lua templates, feel free to ask :).

        Loading editor
    • I'm going to wait and see what Wikia comes up with as a DPL replacement before I try to learn lua :) Does it need any sort of local development environment, or can I do it all through the wiki?

        Loading editor
    • You can do it all through the wiki. Although for learning purposes it is probably better to get a simple offline tool to play around with it.

      There is a nifty editor called [www.sublimetext.com sublimetext] that can actually compile the lua code and output it to a console. It takes a bit of time to get it set up but once it works it is really great.

      I think that regardless of the DPL replacement you should still probably learn lua. Just by seeing the things you do with dpl, I can tell you will likely find really great uses for lua. By the way, lua doesn't really have native DPL functionality, although you can use DPL extension within it.

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.