Questions tagged [variable]

Variable a symbolic name associated with a value that may be changed

6 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
42 views

Trying to display post based on two variables

I am setting three variables like so ... {% set featureEntryIds = craft.entries({ section: 'blog', featurePost: 1, limit: 1 }).ids() %} {% set articleClass = entry.id in featureEntryIds ? 'featured' ...
1
vote
0answers
105 views

I'm repeatedly setting the same variables. How to reuse code block to make this DRY?

I have a very complex layout which is requiring me to have quite a few {% for %} loops on the page and in each loop I need to set a bunch of variables. In order to make my template more DRY I was ...
1
vote
0answers
91 views

How may I restrict uploads to a single folder with variables within a Rich Text Field?

Craft's Asset Fields allow you to restrict uploads to a single folder—and even pass through a variable to create a dynamic path. How may I restrict uploads to a single folder with variables like this ...
0
votes
0answers
16 views

Variable scope in Element API

I am using the Craft Element API and getting a bit muddled over PHP variable scopes. I was hoping if someone could please explain why this does not work: $isProd = App::env('ENVIRONMENT') === '...
0
votes
0answers
14 views

Error when trying to access 'variables' inside the PDF template in Craft Commerce

I'm trying to include the custom image field inside the PDF file of Craft Commerce. I added the following code to the module: use craft\commerce\events\PdfEvent; use craft\commerce\services\Pdfs; ...
0
votes
0answers
462 views

Vanilla Forum Embedded SSO Export User Groups as Roles

I have implemented vanilla forums as a discussion solution for my website. I have made it embed into my parent site and also setup jsConnect to auto sign in the user if he/she is logged into my parent ...