I am creating a responsive template using Percussion’s base (non-responsive) template and adding all the Foundation file references manually.
So in order to use the Foundation drop downs and the off-canvas menus, the following type of attribute needs to be assigned to the div class and here are a couple of actual examples (the ones that begin with “data-”:
How can I assign these to Percussion container regions that don’t have content? As far as I know, I can only assign classes to a region or widget. Please advise how I can accomplish this.
You are correct, you cannot assign data attributes directly through the CM1 interface. You would have to use javascript to add the data fields to the divs.
In the above example, you will want to set the div_id to the id/name that you gave the div/region in Percussion. The [att] needs to be changed to whatever data- attribute you want. This is the part after data- . The []'s are not needed. If you need to do more than one attribute doe the following:
for each attribute you want to use. Like before change the div_id to the div/region id/name and then set [att] to the type of data attribute and then set the value it needs to have.
You will want to either do this at a page or template level depending on how ofter you need this.
Matt,
That definitely solved the issue of adding the “data” attribute, thanks. There’s just one more obstacle to getting the Foundation off-canvas menu to work.
The entire page needs to be nested inside an “inner-wrap” class and then an “off-canvas-wrap” class. Percussion adds another div in between them and as a result the off-canvas menu will not function. To test this, I downloaded the source code that Percussion created, removed that extra div class=" perc-vertical " and the feature now works.
Here are the 3 divs and I believe I need to be able to do one of two things: either remove that extra div OR be able to assign the “inner-wrap” class to it.
You will notice that the div_id has a # symbol in front of it. That signifies that it is the name/id of a div. The second one per-vertical has a . before it to signify it is a class.
The above code appeared to add the “inner-wrap” class to all Percussion-generated DIVs inside the outermost wrap. Our back-end developer just tweaked it and now it works. Thank you.