twig show all content raw like {{#equals language "en"}} - symfony

We're working on twig to merge multiple values. The idea is to have multiple twig templates each containing the value of it's language.
The problem is the values contain handlebars conditions like {{#equals language "nl_NL"}} that causes trouble in twig.
Is it possible to show all contents raw?

Related

Creating a list out of single entities

2sxc question. I have a lot of single entities of a content type that I want to combine into a list. Essentially, I have four columns and each column has an individual 2sxc content module in it. The column layout is controlled by DNN content panes. What I want to do is create a list template for that content type and add those individual items to the list. The columns would be created in the list template dynamically.
Is this advisable, or am I better off just recreating the content and using a new list template. If it is feasible, what steps would I have to take to make the conversion.
Thanks
This is very easy. The only question is if you want to manually choose which items to show in the list, or if you want to query it like a DB.
Manual approach: create a new template, say it's a list, and you're ready to go. You'll have to add "demo-items" and then "replace" them with the real one, so the initial setup has a lot of clicking.
Query-approach: create a new template, but then loop over the App.Data["Type"] instead of the Data["Default"]
ok?

Mailchimp RSS loop, get index

In RSSITEMS loop, I would like to find a way to get an index variable (0,1,2,3,4 for 5 items) so I can display items at different places. I couldn't find a way to do that, so I passed a variable in RSS tag, but I can't access it with conditional tags like *|IF:RSSITEM:COMMENTS_URL = 1|* (it simply doesn't work but I can print the variable without problem (1).
Mailchimp support told me it's not possible. Instead, I modified the feed to include 1 item which is HTML with my multiple feeds parsed. I now realize I could have used |FEED:...| merge tag with a standard campaign.

how to change a drupal views output

I need to create a block with eg the latest comments on the site.
when using views, concegui select the data I wanted, but the problem is that I need to edit the output of view (specify the html). I tried to make a tpl, but the fields when they get to this, are already formatted ([#markup]). also tried to make a block programmatically by accessing the fields of view, via $comments = views_get_view('last_opinions');, but so the fields do not bring content, but for example, ids (for referrals), or integers (in the case of dates), ....
basically, how to change views output?
views->your view->advance(third panel)-> Theme: Information -> click Information ->choose tpl as per your requirement and find $row which actually prints your output

Select date fields for only 6 months beginning with current in Drupal Views

I have a content type with a date field which can have multiple values.
How can i select the dates in Views for each month separately, beginning with the current month and have table columns titled with the month names?
Views can filter the appropriate nodes easily enough using "filters" and "sort criteria" in the views UI.
But, you probably won't be able to get a table-based view of the nodes in table form without developing a custom module or theme function to render the table HTML. There's really no easy way (that I know of) to turn a specialized query into an HTML table without digging into PHP and iterating through query results.
More info on developing modules is at http://drupal.org/node/508
And is it posible to do it by selecting the date field six times and passing six arguments?

D6: how to get at node fields in preprocess_page()?

i created a view that displays my homepage fine but now a modification is needed: i load 2 fields (images) in my view but need to only display one of those, depending on the value of a third (date) field and today's date. if date field is later than today, show image y and if its earlier than today show image x. this kind of logic cant be done in a view.
so in my template.php id like to output x or y as $vars['img'] in the preprocess_page function. im just wondering, how do i get at the values of those fields? its not a node but a list of node teasers.
the function gets passed &$vars but a print_r of those just shows the html output.
custom sql seems not the way to go.
when i load the view, i just get the html it outputs but (i think) i need the raw data to make the date comparison.
thanks for any pointers!
I'm sure there are some ways to do this, some more hackier than others. I would:
Make a template specific to your view
Create a preprocess function for the view and create a boolean variable, by checking which img that should be displayed.
Lastly I would alter the template slightly by making an if statement that checks if it should display img x or y.
This solution is pretty easy and straight forward, the downside is that it's not completely general as you most likely will need to know the names of the cck field names you are using. It's doubtful you would be able to generalize this anyways.
Edit:
To clarify a bit. You can look at the general views template that's being used, it will give you some insight as to how views prints the different fields. Generally getting at the fields is usually not a big problem when you have the $node object. The reason is that cck adds the fields to the $node object so you can access it there. I believe you can do something in the line of $node->field_[the_name] to get to the field. I would suggest that you use the devel module if you don't already and do a dpm($node) somewhere in the template where you loop through the nodes. That will enable you to see what has been defined on the $node object. It shouldn't be a big problem to print the img from there.
How about using preprocess_node() instead?

Resources