Author Topic: [TUT] Add a url-variable like {url_yourlink}  (Read 17781 times)

0 Members and 1 Guest are viewing this topic.

Offline senloel

  • Full Member
  • ***
  • Posts: 196
    • View Profile
[TUT] Add a url-variable like {url_yourlink}
« on: September 16, 2013, 06:52:38 PM »

as you maybe know, you can add different types of variables in your template files.
One type are the url-Variables.

If you want to add a link to different sites, it's useful to write a variable instead of the whole link.
It's much easier to edit this link, if something has changed. You only have to change the link in one file instead in every template file where you added the link.

This MOD will show you how to add this Variable.

Step 1  :arrow: Open the template files where you want to add a link.

Step 2  :arrow: Add the following anywhere to show the link:

<a href="{url_yourlink}">Yourlink-text</a>

Step 3.1  :arrow: Open includes/page_header.php and search:

  "url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),

add below:

  "url_yourlink" => $site_sess->url(ROOT_PATH."yourlink-url"),

  Step 3.2  :arrow: How to add the link url:
If you want to link to a file which is in your 4images directory:

Use   "url_yourlink" => $site_sess->url(ROOT_PATH."yourlink-url"),
for example:

  "url_yourlink" => $site_sess->url(ROOT_PATH."search.php"),

or with subfolders:

  "url_yourlink" => $site_sess->url(ROOT_PATH."admin/index.php"),

That was it already ;)



  • Guest
Re: [TUT] Add a url-variable like {url_yourlink}
« Reply #1 on: September 16, 2013, 07:19:32 PM »
Thank You!  :thumbup:

mfg Andi