Questions tagged [variable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7
votes
2answers
956 views

How do I assign custom global variables from my config file?

I'm currently developing custom config files. Some of my files are deeply located in my architecture and I want to use some of my variables in the config as specific tag. Example : {site_url}assets/...
7
votes
1answer
799 views

Variables in templates w/o PHP enabled

I have a problem where I need to increment a variable if it satisfies a conditional like so: {matrix_tag_pair} {if matrix_column_name} $increment++ {/if} {if $increment > 9} do this....
5
votes
1answer
929 views

What's the difference between url_title and url_title_path?

I keep running into issues, and apparently I just don't understand the difference between these two variables. One set of pages works with url_title_path, and the other set will only act right with ...
5
votes
1answer
70 views

Why are my entry dates displaying incorrectly in Safari?

I'm not sure what could be causing this. Dates are displaying incorrectly in Safari on my site. They are displaying as 1 day before the actual date that is set in the CP. I've never seen this and ...
4
votes
1answer
2k views

Create a variable from a URL's Query String

How can I create a variable that is pulled from a URL like the one below? eg: http://www.example.com/page.php?Item_ID=774&score=42 Need to pull the number "42" from the url and placed into a ...
4
votes
3answers
128 views

alternative to php var in template?

It's been a solid year since my last ee project. The things you forget over time :) At the top of my template I show the latest featured entry (limit="1" search:featured="yes"). Later in my template ...
3
votes
3answers
508 views

Why are PHP and Stash variables not set as expected within EE conditionals?

I boiled my problem down to this template code on a template with "Allow PHP" set to "YES" and "PHP Parsing Stage" set to "Output": {if 1 == 1} First block <?php echo '1 == 1 is true'; ?> ...
3
votes
2answers
1k views

Using a custom PHP variable in a channel entry start_on and stop_before

I am attempting to display entries from a specific channel 7 days before and 7 days after an entry_date from another entry. I don't want to use a plugin because. Here's how I am getting / ...
3
votes
1answer
388 views

EE 2.6.1. Combine relationships and related categories for editorial workflow

On our Single entry pages we recommend other articles. Four slots are available. channel: articles. channel fields: Content Elements field for the text and a native EE Relationship field called "...
3
votes
2answers
708 views

Invalid EE conditional variable error - UPDATED

NEW INFO OK, I found that the error was being thrown by a custom exception built into expression engine that will do partial matches on variable names if it doesn't find the original one. From ...
2
votes
4answers
126 views

Is there a plugin that will strip a bit of text out of a string?

I've got a variable like {current_url} which contains the full url of the page you are on. I want to strip out the last segment from it. Is there a plugin or native EE way of doing that? Say that ...
2
votes
1answer
95 views

Appending more data to a layout variable

I'm using template layouts, and setting variables with the {layout:set} tag. Is there a way to append data to an already set variable?
2
votes
1answer
388 views

Passing Variables

I hardly know any OOP PHP so I don't know how to properly pass variables, especially in EE. I am working in a Module, and I have a function that passes my modules results to a .php file that has the ...
2
votes
1answer
46 views

calendar, more efficient code

the goal: -show the remainder of the current month's events always -when end of month is near (after the 18th, for example), also show the upcoming month's events this is what i have presently, ...
2
votes
1answer
56 views

How To Create Headers For A List

I have a list of items. Each item has a season. I am trying to organize the items by season. I believe the list is pre sorted and I need to create a header everytime there item has a new season In ...
1
vote
5answers
736 views

Custom variable within tag pair?

I need to restructure the channel entries (I'm trying to group them by one of the channel fields). For example, say I have a list of fruits and each fruit had a color. I'm trying to group these fruits ...
1
vote
1answer
1k views

Create tag pair variables

I now have my module working like I need it to and my single tag pair calls the correct function. But I'm wanting to create a tag pair that is common in most modules/plugins. Here is the function I am ...
1
vote
1answer
365 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 ...
1
vote
3answers
139 views

Invalid EE Conditional Variable

This error: Invalid EE Conditional Variable Filename: libraries/Functions.php Line Number: 2761 occurs when I have this code in a BrilliantRetail template: {items} <tr> <td class="...
1
vote
2answers
3k views

Variables in templates

I want to update a variable based on my module. I can pass the variable from the main template (say A) to the embedded one(say B). But how can I retrieve this variable back in Template A after ...
1
vote
3answers
854 views

Email encode tag Javascript issues

I use {encode="{webmaster_email}" title="Send E-Mail"} to hide my email address from harvester bots. When I use this code within my template all is fine. This code is also part of the footer. The ...
1
vote
1answer
942 views

Are {layout:set} variables available to all extended layouts?

I'm trying to make sure I understand the scope of {layout:set} variables, compared to how embeds work. Traditionally, variables set with an {embed="template_group/template variable="foo"} are only ...
1
vote
2answers
630 views

Expression Engine - Passing Custom Field Variables to Layout

I'm trying getting to grips with Expression Engine. Specifically passing custom field information to a master layout I have created two template groups. One for the overall layout including the ...
1
vote
2answers
81 views

How to pass variables and then display the results?

Is there a plugin, technique, or combination of plugins/techniques that will allow me to do the following? My channels are like this: Parent: Product Children: Colour, Size, Style, etc. A search ...
1
vote
2answers
205 views

Switchee with multiple stash variables only evaluates first variable

I have the following code: {exp:switchee variable="{exp:stash:get name='custom_sidebar_text'}/{exp:stash:get_list name='related_articles'}/{exp:stash:get_list name='related_events'}" parse="...
1
vote
1answer
759 views

Parsing JSON in EE tag

We have a BrilliantRetail cart and I'm adding JSON data into an attribute named itemJSON. In the cart template, we loop through the items in the cart using the {items}{/items} tag and I need to show ...
1
vote
1answer
43 views

Something wrong in Stash usage and cannot figure out what

I have this code {exp:channel:entries channel="katalog" limit="12" dynamic="yes" status="open" show_future_entries="no" orderby="date" sort="desc" disable="member_data" pagination="bottom"} {!-- if ...
1
vote
2answers
389 views

Freeform Pro Dynamic Admin Notifications

Is it possible to use a form field as a variable address to send admin notifications to different addresses? The scenario is that the notification needs to be sent to a different address dependent on ...
1
vote
2answers
474 views

Insert Code into Middle of Channel Entry Post

I have a channel that stores ads (HTML ads I created and the Google Adsense Code block), and displays either my html or Google's JS to allow a random ad on each page load. I want to insert that ...
1
vote
1answer
225 views

Expresso Store + outputting store variables using PHP in XML. " and / are blowing up the whole operation

Alright so let me first say that this particular project is very odd and it has snowballed considerably in the past few months. I am not a master PHP programmer. What I am is a web developer with ...
1
vote
1answer
59 views

using globals in channel entry tag

so I am trying to use a dynamic variable, this works {member_id} {exp:channel:entries channel="vacancies" author_id="9"} and this does not {member_id} {exp:channel:entries channel="...
1
vote
1answer
109 views

Stash embeds containing multiple nested plugins doesn't retrieve anything

I'm trying to do some stash embeds but when embeds contain nested plugins (so, more than one) he doesn't retrive any value. {my_loop}{stash:embed name="my_total{count}" file_name="_stash:...
1
vote
1answer
190 views

Channel Images and Matrix / Increment a variable/count within a matrix field?

Is there a possibility to increment a variable/count (something like "i++") within a matrix field so that the variable is incremented for each row with certain parameters? The background is that I ...
1
vote
1answer
97 views

Pagination current_page not retaining

I have the following code: {paginate} {pagination_links} <div class="block_pager"> {previous_page} <a href="{pagination_url}" class="prev">Previous</a> ...
1
vote
1answer
50 views

Assigning a Value From One channel:entries Call To Be Used In Another

In my template I'd like to capture the entry_id of my main channel:entries loop, because I have subsequent loops where I may want to avoid that entry in one case, and invoke it again in another. So I'...
1
vote
0answers
54 views

using stash variable with same name like EE var

loping through channel entries tag, I can use {title} for the title of the article. inside the channel entries loop for the specific article, I use an EE partial with get list inside. Inside the ...
1
vote
0answers
298 views

template variables not parsing inside javascript

I have some javascript in a template and when I try to use template variables inside the ... tags, the template variables are not parsing. All other template vars on the page are parsing as ...
1
vote
0answers
66 views

using Stash to output a language variable with Transcribe

In my article template I'm doing this: {exp:stash:set name="article_lang" parse_vars="yes" parse_depth="2" parse_tags="yes" parse_conditionals="yes"} {exp:switchee variable="{transcribe:...
1
vote
1answer
84 views

Switchable display order for playa field items

I'm trying to arrange it so that the output order of a Playa field can be controlled by a global variable or radio button channel field (to make it able to be toggled from the listed order to random) ...
1
vote
2answers
1k views

How to pass php variable from one EE template to another

I am using a Freeform Pro form where the user can edit a numeric field (number of of places booked for an event). When they click on submit, they are sent to a processing template to do the ...
0
votes
3answers
114 views

var_prefix= not working as one would hope

OK revamped question: now it displays all the right stuff but it doesn't interact with the tabs and stacks them all in a static display. straight forward EE code works fine. Once i insert the prefix ...
0
votes
2answers
422 views

adding a variable to a partial template

I am using creating template parts (header, footer) but would like to know how I can add a variable, a body class to individual templates. I see people are using stash but is there another way to set ...
0
votes
1answer
53 views

Channel Entry in One Variable?

Since I need bits and pieces of a channel entry on various parts of my page, is it possible to store the channel entry in one big variable that contains everything? That way, I can access it ...
0
votes
1answer
74 views

I'm having trouble getting simple IF statements within a Playa tag to evaluate properly

Channels and Fields Summary: Tours channel - stores a list of all Vacations the site offers tour_specials field - a Playa field, linked to the Specials channel indicating which Special Offers apply ...
0
votes
1answer
149 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: '*', ...
0
votes
1answer
81 views

How do I resolve this scope issue with Stash?

I'm just playing around with implementing Stash on a site, following the Template Partials Using Stash article, but now I seem to be having a scope/execution order issue. Layout <html> <...
0
votes
1answer
309 views

Passing preload_replace variables into a plugin

I've been working on my first EE plugin today, and I need to make it dynamic by passing either a PHP variable, or I would have thought I can use a preload_replace variable, from the template that ...
0
votes
2answers
208 views

Preload replace not evaluating variable outside of pair

I am trying to get the current entry's category so I can make a comparison inside a menu elsewhere to see if the menu item is for the current page. I have the following code at the top of my template: ...
0
votes
2answers
52 views

What is the updated version of assign_variable?

In former days {assign_variable: my_var="foo"} was a very handy tool. I haven't used it for some time and discovered that it was deprecated in EE 4.x but was not able to determine what if ...
0
votes
1answer
72 views

CE Image, variable not parsed inside src image

I tried to insert a custom field variable, Stash here, a simple custom field as a text field works fine (the value is parsed), but when I use a pair tag (as Fluid, Grid or another add-on), or a Stash ...