Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [global-variables]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
163 views

$_SESSION Variable in EE

[EDIT - I have posted the answer to my question below] EE 5.2.4 I'm having issues trying to use $_SESSION in EE. What I would like to do is save an Amazon cart ID in the $_SESSION. Working in ...
user avatar
  • 193
0 votes
1 answer
67 views

Insert Selected Channel into the Template

We are creating a template that our client would use on many pages of their website, for example 'Accordion Layout Template'. So we create a page 'Bikes', assign the 'Accordion Layout Template', then ...
user avatar
1 vote
1 answer
71 views

EE2: How to use the {template_group} variable or how to get value of template group in a template?

I am confused about the usage of the mentioned variable. It should be plain and simple... but for some reason, I can't get it to work. Documentation link for EE3: https://docs.expressionengine.com/v3/...
user avatar
1 vote
1 answer
55 views

Deleted Template Variables (created via Low Variables) keep reappearing

http://recordit.co/R8eImfvLyP EE3 with Low Variables installed. I created a bunch of variables in both EE and Low Variables only to try to remove them. They are showing in the Template Variable area ...
user avatar
1 vote
1 answer
83 views

Referrer/URL Helper ee3?

Really need the ability to grab the refering url that URL helper offered. Is this available for EE3 or is there an alternative?
user avatar
0 votes
2 answers
57 views

Selective parsing of {logged_in_username}

I have this in my template layout, running EE 3.4: {if logged_in_group_id == "5"} <script>dataLayer = [{'userID': '{logged_in_username}'}];</script> Rest of the script pass data ...
user avatar
  • 106
0 votes
1 answer
52 views

Global variables parse time

I am currently trying to debug some of the page load times on a website we host, and am running into something I find odd. Global Variables parsing seems to be taking up half the page load time... (0....
user avatar
0 votes
1 answer
97 views

Global variable tags {username}, {member_id}, {screen_name} not working

I've got a weird one going on here. EE 2.8 site. I wanted to create a conditional based on whether it was ME on the site. I wanted to see some info that was not to be rendered to the normal user. So, ...
user avatar
0 votes
1 answer
68 views

edit admin template varibles global variables via cms

how do i edit preferences for global variables in the cms, design > templates > global variables. Iv looked at the following and think it might be what i'm looking to do, wondering if the cms cant ...
user avatar
0 votes
1 answer
83 views

Do EE template partials have a preparse function similar to LowVars?

I'm wondering if there is a way to dynamically set variables within a template partial from the point at which it is included. This works in Low Variables as the preparse function, but is there ...
user avatar
0 votes
1 answer
340 views

{site_url} global variable not outputting in php header redirect

Trying to create the following redirect template for some structure pages, however the url is outputting like this http://example.com/{site_url}#section. Any idea why {site_url} variable isn't working?...
user avatar
  • 273
0 votes
1 answer
227 views

how can i get ee global vars outside of ee?

I have tried something along the lines of $email = ee()->.... and with a hope to include/require the page at the top of an external php page and then echo the value of $email. This doesn't ...
user avatar
  • 129
1 vote
1 answer
369 views

check if a segment is a number

I am trying to figure out a way to set to variable values depending on if a specific segment is a number or not. First how to I check if the segment 2 is a number or not? I want to apply this type ...
user avatar
0 votes
2 answers
102 views

Global variable as a module tag pair's parameter?

I'm trying to pass {ip_address} to a module, which isn't working: {exp:rest url="http://domain.com/{ip_address}" verb="get" format="json"} {/exp:rest} The {ip_address} is getting interpreted as a ...
user avatar
0 votes
1 answer
115 views

CE String outputting global variable tag minus "{ }"

I've got a page behind a login that I have various member groups set up for. Depending on the member group, I want the link in the Downloads section to go to a different page: e.g. Contractors ...
user avatar
1 vote
1 answer
213 views

Creating a php variable for sql query

Can some tell me if I'm wrong, but it doesn't look like I can create a variable to store a query result into it where I leveraged EE's native {exp:query} functionality? I want to use PHP native ...
user avatar
0 votes
1 answer
144 views

How to Modify a Global Date Variable

Is it possible to modify a date variable (entry_date in this case) so that you have entry_date plus one year (or any other amount of time)? For example, if entry_date was 6/4/14 2:59 PM, could I add ...
user avatar
  • 13
0 votes
1 answer
150 views

Include CSS file in JS

I have a problem with url in js file First, in Snippets i have code In that init.js i have that (function($) { skel.init({ reset: 'full', breakpoints: { global: { range: '*', ...
user avatar
  • 43
0 votes
1 answer
112 views

Using structure global variables in embeds

I'm trying to create a navigation menu inside an embed, I have the following code in my main template: {exp:structure:entries parent_id="{structure:page:entry_id}"} {if channel_short_name == "...
user avatar
  • 693
0 votes
1 answer
45 views

Why is this comparison check not working on a Windows box?

I've set up the following code on a site. On my Mac (dev version - identical to the running live code) the template looks like this: {if '{current_path}'=='/'} ... {/if} And this works fine. But the ...
user avatar
  • 141
2 votes
1 answer
386 views

Twitter Summary Cards in ExpressionEngine

Any ideas how I can make use of Twitter Summary Cards via ExpressionEngine?
user avatar
  • 2,473
0 votes
1 answer
122 views

Dynamic navigation on an MSM setup using {site_url}

I have an MSM setup where the primary site is the "main" site in EE and the subdomains are all sub-sites in EE. I have built out the primary navigation in the main site, but I don't know a good way to ...
user avatar
  • 1,610
2 votes
2 answers
1k views

How to use global variables in if-condition?

Say I have a global variable foo. To output it in the templates, all I have to do is: <h1>{foo}</h1> However, I can't seem to use it in an if-condition. For example: {if foo == 'bar'}&...
user avatar
0 votes
1 answer
207 views

Focus Labs Master Config $env_global not working

I'm having the same issue as described below, however can't find a solution: Using Focus Lab's Master Config, I've set a test global variable for production, like so: $env_global['...
user avatar
2 votes
1 answer
64 views

A standard global variable in the params for a module is not being parsed [duplicate]

I have a module tag with a param that accepts a string. {exp:test:foo return_url="{current_url}"} ... {/exp:test:foo} In the module method, I get the return_url param using $return_url = $...
user avatar
  • 2,347
0 votes
2 answers
154 views

Freeform default_value not working with global email variable

So I am building this "booking form" (really it just emails somebody) and I want the form to be pre-populated with the user's details if they are logged in. I have this mostly working, but the email ...
user avatar
0 votes
1 answer
208 views

Reason why site_url would work in template, but not current_url?

I have the following code using the {site_url} variable, like so: <div class="g-plusone" data-annotation="inline" data-width="300" data-href="{site_url}"> However, when I changed the variable ...
user avatar
  • 125
0 votes
1 answer
519 views

Assets "count" variable

I looked through the docs and wasn't able to find a count variable to see what file you are in using a field tag. For example, I want to detect when the first file is being looped though my custom ...
user avatar
7 votes
2 answers
4k views

How to create a global variable inside config.php

I'm trying to build a simple config bootstrap for use in multi-server environments. I realise there are lots of config bootstraps around, but a lot of the popular ones seem a bit complicated for what ...
user avatar
  • 1,349
2 votes
1 answer
722 views

Retrieving/setting cookie in index.php

I'm attempting to retrieve a cookie in index.php to record the value in a global_variable. I'd like to do it this way to avoid including PHP/plugin code on every template. Currently I have; $...
user avatar
1 vote
1 answer
121 views

Is it correct to put "{site_url}" inside a global variable?

As the title says, is it correct? Thanks
user avatar
2 votes
1 answer
77 views

Display Number of Active Members

I'd like to be able to display the number of "active" members on a site. Ideally this would be something like "number of members who have logged in in the past 30 days". Barring that, I'd settle for ...
user avatar
  • 2,724
3 votes
3 answers
536 views

Conditional with Ip Address

This one has me baffled. I'd like to show some content based on the Global variable IP Address. But none of these work: {if {ip_address} != 127.0.0.2}SHOW THIS{/if} OR {if {ip_address} != '127.0.0....
user avatar
5 votes
3 answers
1k views

Global Variable Parsing in Add-On Module

Trying to figure out what appears to be a global variable parse issue in a module add-on template tag. Here's a sample of the tag used in the template: {exp:syn_fb_comments:show url="{current_url}"}{...
user avatar
  • 155
1 vote
1 answer
149 views

Development (Local) with multiple sites using host file and IIS7 - Can't get FCPATH to recognize - Encoded characters

I am stuck again using IIS7 on a windows server. Trying to replicate the production environment for some testing on a Win7 box using IIS7 and host file to point o the sites. I have tried using ...
user avatar
  • 1,610
2 votes
2 answers
91 views

Website's Company Information Stored In A Channel - good or bad?

I created a channel that has fields like: company name address a matrix of daily working hours etc Throughout the site, I need to display bits and pieces of this data. Does that mean I need to use ...
user avatar
5 votes
4 answers
2k views

path=logout - how to configure URL it redirects to?

I have put a logout link on my site. When I click it, I am logged out and redirected to the homepage. How do I specify a different page to redirect to?
user avatar
0 votes
3 answers
233 views

Problem with custom global variable

I created a custom config file with my own global variable. When I'm using the EE debugger, I have an output of my global variables: So, I guess, they exists and I can access to them. The problem ...
user avatar
  • 278
5 votes
3 answers
297 views

Breaking my HTML into tiny pieces - template, snippets, or globals?

In order to maximize code reuse, I'm trying to break down the mark up for each of my form fields into individual "containers" (e.g. a template, snippet, global). The project I am working on is form-...
user avatar
4 votes
3 answers
466 views

setting a global var in an embedded template with PHP

I have a header template with PHP parsing on Input an the following code: <?php $this->EE->config->_global_vars['user_language'] = "nl"; ?> When I use {user_language} in my header ...
user avatar
  • 1,289
3 votes
2 answers
200 views

Why wouldn't global variable parse correctly with Master Config?

Using Focus Lab's Master Config, I've set a test global variable for production, like so: $env_global['global_test'] = 'test'; Then in an embedded template I've dropped in {global_test}. Also tried ...
user avatar
  • 626
15 votes
2 answers
3k views

What is the difference between a global variable, a snippet and an embedded template?

What is the difference between a global variable, a snippet and an embedded template? When and where should I be using each of them?
user avatar
  • 7,176