FANDOM


  • Hello!

    First time posting on the forum. Anywho, having issues trying to figure out how to make this template fully work. Template:ItemObtain Here's the Template and I've marked the area I'm having issues with the hidden comment tags.

    Now, what I'm trying to do is have it to where everything in the Example under Bag will basically be put into the template itself and only show up when data is input. I hope I explained it fairly decently.

    I've done what I can for other sections of this template, but this one section is giving me the most issues, because of the fact that any section of that can be there or not. Not sure if that makes sense.

      Loading editor
    • did you read #if?

      1. #if: *Daily Login Bonus and other similar stuff makes no sense: this "expression" will be evaluated as true, so you can remove those ifs - it will make the code simpler.
      2. you may want to eliminate all needless linefeeds (the thing that you adding by hitting the "enter" key).

      as far i understand, you want to show image (bagicon) and text (boxes) if the "boxes" param supplied. this part itself works well. sure, it produces some empty lines, but you will deal with them on #2.

        Loading editor
    • In response:

      1. These make it to where if there is no data in the variable, that whole bulleted item won't show. Which is what I'm going for since this is a somewhat dynamic template. And I've tested it that if there is no Data in the nothing shows up.

      2. Not sure exactly what you mean by eliminate them. From what I can tell I need them? Maybe there's something you're seeing that I'm not

      And yes, for the Bag section. I want the bulleted items underneath to show, but dynamically. So, if only 3 of the Box Types are needed they will show, but not all of them. Does that make sense?

        Loading editor
    • ShaitanSedai#3
      These make it to where if there is no data in the variable, that whole bulleted item won't show

      no, they don't. #if: *Daily Login Bonus is always true.
      ShaitanSedai#3
      Not sure exactly what you mean by eliminate them. From what I can tell I need them?

      remove them. delete. kill. if you can't say that you need them, then you don't need them. https://snipboard.io/OdYK5j.jpg it is your template with boxes parameter only. red line shows start and end of the template. this empty space: is it expected behavior?
        Loading editor
    • I don't believe it's expected behavior, no. I'm still somewhat new to template building and this is the first time I'm dealing with the IF function. I have read about #if and trying to make it work.

        Loading editor
    • {{#if: {{{Boxes| <!-- is "Boxes" used? --> }}}
      | <!-- yes: display this --> *[[File:BagIcon.png|50px]][[Bag]]
      {{{Boxes|}}}
      | <!-- no: display nothing -->
      }}
      
        Loading editor
    • TableWiz wrote:
      {{#if: {{{Boxes| <!-- is "Boxes" used? --> }}}
      | <!-- yes: display this --> *[[File:BagIcon.png|50px]][[Bag]]
      {{{Boxes|}}}
      | <!-- no: display nothing -->
      }}
      

      Thanks for that!

      Now question, so for the data inside of the Boxes Parameter. Is there a way to make that itself variable data as displayed in the Example portion of my template appear/disappear like it is done with the others. I'm sure I could do it with the Switch function, but it seems like it would be overly messy?

        Loading editor
    • Using this part as an example

      {{#if: {{{Summon|}}}
      |*[[File:SummonIcon.png|50px]][[Summon]]
      {{#switch:{{{Summon|}}}
      |Event = **[[File:EventSummonTicket.png|25px]] Event Summon
      |Basic = **[[File:BasicSummonTicket.png|25px]] Basic Summon
      |Seduce = **[[File:SeduceItemSummonTicket.png|25px]] Seduce Item Summon
      |Coins = **[[File:CoinsSummonTicket.png|25px]] Coins Summon
      |Event, Basic = **[[File:EventSummonTicket.png|25px]] Event Summon
      ...
      


      Variable "Summon" becomes the switchword

      {{#if: {{{Summon|}}}
      | <!-- yes: display this --> *[[File:SummonIcon.png|50px]][[Summon]]
      **[[File:{{{Summon|}}}SummonTicket.png|25px]] {{{Summon|}}} Summon
      | <!-- no: display nothing -->
      }}
      


      If "Summon" was "Basic" it would display

      *[[File:SummonIcon.png|50px]][[Summon]]
      **[[File:BasicSummonTicket.png|25px]] Basic Summon
      

      But it will display an error for invalid "Summon" or typos

        Loading editor
    • I see. thanks for the assistance! I'll see what I can do with this knowledge

        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
Community content is available under CC-BY-SA unless otherwise noted.