XtGem Forum catalog
ADS By Strikecoded:
Smash Your 2018/19 Jamb, Waec, Neco With CAMPUSBASE Visit Now.. Best Java, Android Games, Apps


No1. Naija Awarded Download Portal For Both Mobile And Pc Users..

Home | Blog | Search | Uploads

»XtGem Getvariables Tutor
XtGem get-variablesThese can be used on ANY XtGem site WITHOUTupgradingThis is a very complex subject so I will only cover the basics hereXtGem "get" variables can be used to replace any text or code in your site with a value that has been declared in a link or formIn your code or text a variable looks like this{_$variable_name|default_value}Original XtBoard post
a simple form to display you#form" method="get">
Enter your name

Enter your age


your name is currently unknown your age is also unknown
The Form<form id="myform" action=" http://MY_SITE.COM#myform" ; method="get">This sets up the form and tells it where to go. (in this case back to itself)
You can also use method="post" so that thevariables will not appear in the url box<input type="text" name="myname" value="{_$myname|}" />
<input type="text" name="myage" value="{_$myage|}" />
input the values for name and age
The xt variables restores the last value of name and age after the form has been submitted<input type="submit" value="GO" /></form>Submit the form and close it
The output of the formyour name iscurrently unknown
your age is also unknown
your name is {_$myname|currently unknown }
your age is {_$myage|also unknown}
The Xt variables alter the text that is output
Setting the values with a linkYou can set the values in the query string of a link
my name is Ringo Starr I am 56
You start the query string with a ? and use & to separate variables
<a href=" http://MY_SITE.COM?myname=Ring o Starr&myage=56" >my name is Ringo Starr I am 56</a>This link reloads the current page with the values for name and age set
Passing values to another page
To pass the currently set variables to another page on your site you must set the current values in the link to the new page
a new page<a href="anotherpage?myname={_$myname|}&myage={_$myage|}">A new page</a>NOTE: the <xt:url /> and <xt:referer />
hidden Xt functions
Will pass on any variables set in the url of a link or in forms using method="get"AUTOMATICALLY
Using in XT functions and widgets
This chatt box has it's custom key set by myname myage from the form above or below
Enter your name

Enter your age


your chatt id is Ringo Starr56




Use in Javascriptclick me
<a href="javascript:alert('Hello {_$myname|stranger}');">click me</a><br />
Hiding thingsYou can use variables to hide or reveal parts of a page. there are 2 ways to do this
Hiding in commentsHide and show using html comments. Anything between <!-- and --> is ignored by the browser. This places comments at the beginning and end of a section of code
This is what the browser sees<!--span >Hiding in comments</span--><span >This will show on page load</span>This is the actual codeShow itnow
The code for the links
What the browser sees
<a href="http://tutorial.graham.yn.lt/Getvariables?hid=& amp;hid2=!--">Show it now</a><!--a href="http://tutorial.graham.yn.lt/Getvariables?hid2="& gt;hide it now</a-->This will show on page load
Hiding with csshide and show using css. this uses the cssproperty "display:" to hide or reveal sections of code
Show hidden and hide whats showingSwitch back again<div style="display:{_$hide2|block};border:4px outset #800;background:#f80;padding: 1em;width:72px;margin:0 auto;text-align:center">This shows on page load</div><div style="display:{_$hide|none};border:4px inset #080;background:#0f8;padding: 1em;width:72px;margin:0 auto;text-align:center">This was hidden</div>
This shows on page load
This was hidden


Page Statistics

DataLoads
Online1
Today's Hits 1
Total Today's Hits2
Total Hits This Week 3
Total Page Hits 929
Total Forum Members189

Close Page Information

Go BackPromote Forum Services Members About us Terms of use Advertise News update Contact us Feedback

chart1FOLLOW US ON

FBTWG LDRS
Back to the Top

Copyright © . Theme by STRIKECODED TECH.

Desktop View