HomeHome  
  • WelcomeWelcome  
  • Events  
  • PublicationsPublications  
  • FAQFAQ  
  • SearchSearch  
  • MemberlistMemberlist  
  • UsergroupsUsergroups  
  • RegisterRegister  
  • Log inLog in  
  • You are not connected. Please login or register

    FMCodes » Archives » Variables in templates

    Variables in templates

    View previous topic View next topic Go down  Message [Page 1 of 1]

    Niko

    avatar
    Administrator
    Variables in templates

    Description


    You can know how to add variables in templates, that don't work actually...
    Read more: AVAC resource

    Set up


    First put this:
    Code:
    <span id="username" style="display:none">{*USERNAME}</span>

    Into somewhere where you can put HTML, i put it in the forum description box. (obviously remove the * )

    Then put this into a javascript file:
    Code:
    $(document).ready(function() {
    var x=$('#username').html();
    $('.templateuname').html(x);
    });

    Name it what you want.

    and then in the templates wherever you want to put the username put:
    Code:
    <span class="templateuname"></span>

    You can put this in as many places as you want in the template

    Technical problems


    The tutorial was tested on this forum and with the browser Google Chrome; If you notice that the tutorial doesn't work for a browser or for a version of forum (PhpBB2, PhpBB3, PunBB, Invision) contact an administrator and we will fill this field with your reporting.

    Thanks, the staff
    For every problem or question please, contact us in the section Support for the tutorials, The staff will answer you as soon as it is possible...

    Friendly,
    The team of the Forum of Codes.



    Last edited by Niko on Sun Apr 15, 2012 12:48 pm; edited 1 time in total



    Niko wants you in the team Guest

    Community manager and Administrator at Forumattivo.com

    View user profile https://www.fmcodes.com/
    Share this post on: diggdeliciousredditstumbleuponslashdotyahoogooglelive

    avatar

    Post on Thu Apr 12, 2012 11:05 pm by Nick

    I've seen this tutorial before, but still nice to have here.

    avatar

    Post on Fri Apr 13, 2012 9:30 pm by LGforum

    Its not really a tutorial, its something I made up once on the support forum.

    I wrote a tutorial of how to do it wih multiple variables here: http://www.avacweb.com/t125-17-variable-in-html-pages-and-templates

    I wrote it in a way that means its very easy to add more variables to use to it.

    avatar

    Post on Sun Apr 15, 2012 12:47 pm by Niko

    @LGforum wrote:Its not really a tutorial, its something I made up once on the support forum.

    I wrote a tutorial of how to do it wih multiple variables here: http://www.avacweb.com/t125-17-variable-in-html-pages-and-templates

    I wrote it in a way that means its very easy to add more variables to use to it.

    Well, I added your link in the tutorial as a resource (:

    avatar

    Post on Sun Apr 15, 2012 6:00 pm by Nick

    I think we're okay now?

    avatar

    Post on Sun Apr 15, 2012 7:31 pm by FastCode

    Why you don't make a original tutorial? Only copy?

    avatar

    Post on Sun Apr 15, 2012 9:44 pm by LGforum

    He didn't copy my tutorial. Even I don't think that.

    I wrote that tiny snippet of code and designed that concept in a random post on the support forum. I'm not surprised the idea has been folowed and continued really.

    avatar

    Post on Wed May 28, 2014 8:25 am by J0k3R^

    lol thats what i was looking for.
    thanks!!

    View previous topic View next topic Back to top  Message [Page 1 of 1]

    Permissions in this forum:
    You cannot reply to topics in this forum


    YOUR BANNER HERE
    728x90
    DMCA.com Protection Status
    © PunBB | Contact | Report an abuse