Changing the CQ5 generated div tag around components

We are going to use CQ5 as a content platform to be consumed by another service which is the end-point for our users. As in we will be providing HTML for small sections of the front facing websites.
To alleviate any issues that might come up from this integration, we are going to add a prefix to all our CSS classes, ids, and put all our JavaScript in namespaces. The problem is the cq:include tag creates a <div> element around the component's JSP code and then adds the component name, super types, and JCR node title as CSS classes for this div. For example:
<div class="parbase image tout-image">
    <img src="..." class="prefix-our-image" />
</div>
<div class="subtitle tout-subtitle">
    <div class="prefix-our-subtitle-div prefix-subtitle">
        <h2>Header Subtitle</h2>
    </div>
</div>
Is there any way we can change the default behavior of CQ5 to prefix the css classes and IDs? At least in non-edit mode as to not break the author experience as seen by setting cq:noDecoration to true. We tried cq:cellName but didn't see that changing anything. We are using CQ5.4.

Hi Shelly,
I applied your suggestion to my jsp. But it still doesn't work. I added cq:noDecoration=true & added foll. lines of code to my jsp. It dosn't let me edit the component in edit mode.
%@page import="com.day.cq.wcm.api.components.IncludeOptions"%>
<%@page import="com.day.cq.wcm.api.WCMMode"%>
<%-- Set Vars --%>
<c:set var="titleLines" value="<%= properties.get("./titleLines", String[].class) %>" />
<c:if test="${empty titleLines}">
    <%-- Use page title if no title lines have been set --%>
    <c:set var="titleLines" value="<%= new String[]{resourcePage.getTitle()} %>" />
</c:if>
<%-- Component Markup --%>
<c:if test="${not empty titleLines}">
<header class="${componentName}-component ${componentName}-header ${fn:trim(compClassId)} page-header">
    <h1 class="${componentName}-headline page-title">
        <c:forEach var="title" varStatus="loop" items="${titleLines}">
            <c:if test="${not empty title}">
            <span class="${componentName}-line ${componentName}-line-${loop.count}  ${namespace}line${loop.count}">${fn:escapeXml(title)}</span>
            </c:if>
        </c:forEach>
    </h1>
</header>
</c:if>
<c:if test="${isEditMode}">
    ${editComponentTitleLabel}
    <c:if test="${empty titleLines}">
        ${fn:replace(editComponentErrorLabel, "{0}", "Please specify a title")}
    </c:if>
</c:if>
<%
if (WCMMode.fromRequest(request) != WCMMode.EDIT && WCMMode.fromRequest(request) != WCMMode.DESIGN) {
     IncludeOptions.getOptions(request, true).forceSameContext(Boolean.TRUE);
%>

Similar Messages

  • Dreamweaver CC fluid grid, can I change the position of DIV's based on Mobile, Tablet, Desktop view?

    Hi all,
    Currently working on my first Dreamweaver CC fluid grid / responsive site. I want to optimise the pages layout for Mobile, Tablet and Desktop.
    I can see that I can hide individual div elements by adding "display: none;" to the mobile media query code in the CSS.
    I am wondering am I able to change the position of DIV's in relation to the order of each other some how using a similar way?
    Eg I have a webpage design for desktop like.
    Title
    Nav
    Description
    Buy Button
    Photo
    On mobile I'd like to be able to bring that Photo up towards the top of the layout eg.
    Title
    Nav
    Photo
    Description
    Buy Button
    I was hoping those up and down arrows you see in the Dreamweaver CC interface was going to some how make the changes to each view Mobile, Tablet, Desktop, but all that is doing is moving the position of code in the HTML amoung each of the main DIV sections.
    Or am I at the point where I will need to create a seperate page for mobile only to make a layout change like this?
    Any help would be great

    Hi Complexity,
    I have got some further info, and if I have lead you astray I am sorry.
    I don't think you can change the order of the divs in a responsive layout in DW CC.
    However, you can arrange the divs to sit under or beside each other differently in each of the layouts, for pc, tablet or phone.
    You can also switch divs off and on in each of the layouts, having them display in one size screen and not in another.
    So what you would need to do is to create a couple of nav divs, if you want a nav at the top of one type of screen and one at the bottom. You could duplicate the content in both of them and switch one on in one layout and one off in the other.
    I hope this helps!
    I am doing my first layout for a client using DW CC responsive layouts. I have done two test/hobby sites already.
    It is a bit of a mission learning it but I am getting there.
    I do find it interesting that most people recommend using other programs to do responsive rather than Dreamweaver's fluid grid layouts. I don't think many people are using it yet.
    Regards,
    Mary

  • Changing the src of include tag using selectonemenu with ajax

    tell me how to change the source of include tag so that it will show a new page as my select one menu changes..
    and also i don,t want to reload the whole page so i want to use Ajax in that so if anyone have some
    idea how to do it please post......

    Help me!

  • IPhoto changing the names on already tagged faces

    I've already tagged several faces in my iPhoto library but in some pictures, iPhoto has changed them to someone else's name. I've changed it back several times but for a few photos it just keeps changing it to someone else again (and not always the same person!). There are also some faces it keeps asking me to identify even after I've identified them several times. I've even tried deleting the face tag and retagging it but that doesn't work. Anyone else run into this problem?

    Right click and then go to show info and change the song name there.

  • How to change the automatically generated email address?

    Hello,
    The description of the problem is as follows:
    When our system sends to the customer the report with account statements (as an attachment) the automatically generated text that he receives in the email is:
    "Please respond to "K047472" "
    but the text should be:
    "Please respond to "(..here must be a certain email address we want the customer to respond)"
    Do you have any idea how to change this?
    regards,
    Slawek

    Hi Slawomir
    Please go to SE91 and change the message text.
    thanks
    Ashok
    assign points for useful answer

  • Changing the Text Cursor for all Text Components

    Hi,
    The users have asked me to change the text cursor i.e, the vertical cursor for all the text components in our application.
    Is there a common way to change it , without having to call the setCaret method for each of the text components ?
    I saw that Cursor class has a Cursor type called TEXT_CURSOR. I'd like to be able to change that cursor.
    Any ideas, suggestions?
    Thanks!

    I was talking about the blinking vertical caret - sorry I got confused between the I-beam cursor and the caret(!).
    I wanted to change the caret color at the very least.
    Although preferably, I would like to make it a bit wider.
    I just found one solution to change the caret color across all the textfields using UIManager -
        Color caretColor = Color.GREEN;
        UIManager.put( "TextField.caretForeground", caretColor);
        UIManager.put( "FormattedTextField.caretForeground", caretColor);
        UIManager.put( "TextArea.caretForeground", caretColor);
        UIManager.put( "PasswordField.caretForeground", caretColor);Thanks

  • How to change the auto generated thumbnail images for a clip?

    When iMovie created all the thumbnails for my clips it got most of them right, but on some of them it has choosen a frame that doens't really represent that clip.
    Is there any way to change the poster frame for each clip?

    Hi,
         Afte uploaded record it create internal number (Personal ID), and it get stored in table MESSTAB. And that internal number is stored in field MESSTAB-MSGV1. Use this MESSTAB-MSGV1 field for the further use.
    Hope, it will help you.
    Thanks & Regads,
    Poonam.

  • How to change the date generate absence quota(Time Evaluation)

    Hi all experts,
    Currently system use Time Evaluation, and generate absece quota in last day of month.
    So any way to change that system will use differ day to generate absence quota?
    Example use day 28 of each month will generate absence quota? Have any enhacement or configuration?
    Thank you,

    Tatsuya,
    there 2 better solutions for this, one is Generate Period Parameters and according accordingly the month end date you follow and use the same period parameter in V_T559L table to your Quota.
    and other Solutions is Write a PCR like Below.
    ABCD     (PCR Name)
       varstcrumo
            Varstreday
                 28
                   hrs=1
                   adddbTIME (TIME - Daily Time type - Create it in V_t555a table)
    Save it and go to TM04 Schema, and put this PCR with Function ACTIO and make sure to insert this before QUOTA Function and Before CUMBT. and save it, and dont forget to put TIME Time to your Base entitlement.
    you can run Time Evaluation to test it...let me know how it worked.

  • How To Change The Patter generates during creation of Prog using SE38

    Dear Guru,
    I have Encountered an Issue.
    The Scenario Is like this :-
    As soon as we create a new prog using SE38 it automatically generates a standard pattern like below :
    *& Report  ZSR_TEST_05
    REPORT  ZSR_TEST_05.
    But the requirment is like this as soon as we create a new prog using SE38 it automatically it should generate the The Pattern like below :--
    *& Project            :
    *& Program Name       :
    *& Transaction Code   :
    *& Program Type       :
    *& Functional Domain  :
    *& Technical Coding   :
    *& Functional Guidance:
    *& Coding Review      :
    *& Spec. Review       :
    *& Program Description:
    REPORT  ZSR_TEST_05.
    After going through sdn documentation i have identified that using dynamic pattern we can create this and call that dynamic pattern using PATTERN button in ABAP editor.
    But the thing we require as soon as we generate the prog thr. SE38 atomatically all the details must generate before the report <report_name>.
    For achieving thins what i have to do ... please show me some path to achieve this
    Thanks & Regards
    Saifur Rahaman

    Hello Saifur
    Not sure if you can make SE38 to do what you want (yet it is likely). If you do not want to create lots of ABAP patterns why not define a simple ZTEMPLATE report containing the basic set of comments:
    *& Project            :
    *& Program Name       :
    *& Transaction Code   :
    *& Program Type       :
    *& Functional Domain  :
    *& Technical Coding   :
    *& Functional Guidance:
    *& Coding Review      :
    *& Spec. Review       :
    *& Program Description:
    REPORT  ZTEMPLATE.
    *& Initialize report
    INITIALIZATION.
    *& PBO of Selection-Screen
    AT SELECTION-SCREEN OUTPUT.
    *& PAI of Selection-Screen
    AT SELECTION-SCREEN.
    *& Begin of Main Program
    START-OF-SELECTION.
    *& End of Main Program
    END-OF-SELECTION.
    New reports are then created by copying your ZTEMPLATE template.
    Regards
      Uwe

  • How can I change the appearance of html report file generated from Teststand to that I change the orientation of the data in the tables?

    For instance, I'd like to have the measurement results, limits, and status all on one line in a table.
    I am running Teststand 2.0 on Windows 2000.

    Hello Joel_IEI,
    You can modify each report entry as it is being generated by doing the following steps:
    1) In the TestStand Sequence Editor's Report Options, change the Report Generator to "Sequence".
    2) In your sequence file, override the ModifyReportEntry callback. In this callback, you can modify or even replace ENTIRELY the default report information TestStand plans to append to the report. You can use Statement steps to modify the contents of Parameters.ReportEntry (the TestStand variable that you will use to do this), or replace the contents entirely!
    You can look at the code example Adding Extra Results to a Report Using the Modi
    fyReportEntry Callback Sequence for more information.
    David Mc.
    National Instruments

  • Changing the llook and feel of components

    hi,
    i want to change the look and feel of my components. What are the available options that i can give. Anything other than alloy and metallic.
    thx in advance

    Hi,
    you should also try this link:
    http://www.javootoo.com/
    Many Look & Feels available there. However not all of them are good to use in applications. In my opinion the metal look & feel provided with Java is very nice and it can be used everywhere.
    L.P.

  • When I Insert DIV tag, where is the rule?

    http://www3.telus.net/~jessum
    Q1) See on my page where it says "Content for new DIV tag
    goes here". How do I select this and edit it? When I selected the
    "insert new div tag button" I thought it was supposed to add a new
    rule under the <style> tag but I don't see it there.
    Q2) Also see where the wine color "Sidebar" is. How do I get
    the sidebar to extend to the footer?
    Thanks in advance :)

    When you insert a new DIV, you have an option to also create
    a new CSS rule
    on the INSERT DIV dialog panel. Click it.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Comp. 792" <[email protected]> wrote in
    message
    news:ge66kt$quo$[email protected]..
    >
    http://www3.telus.net/~jessum
    >
    > See on my page where it says "Content for new DIV tag
    goes here". How do I
    > select this and edit it? When I selected the "insert new
    div tag button" I
    > thought it was supposed to add a new rule under the
    <style> tag but I
    > don't see
    > it there.
    >
    > Thanks in advance :)
    >

  • JSTL Change the order in which children tags are processed

    Hi there,
    Is there any way one can manipulate the order in which tags are executed/processed within for example an iteration tag? I.e. let's say I have the following:
    <m:my_iterate_tag data="data">
      <dotag1>XX</dotag1>
      <dotag2>YY</dotag2>
    </m:my_iterate_tag/>The user can set as a preference in my application that they want <dotag2> to
    be displayed/executed first before <dotag1>, e.g. like in a column in a table. How can I change
    the order of these tags when I execute the <m:my_iterate_tag>? Do I do it in
    <m:my_iterate_tag> or is there another or better way? Please help.
    Thanks,
    Marius Botha

    Okay, lets start with getting the order in which to display columns... So you say:
    get the order of these columns from the db (e.g. client
    says 1=title, 2=number, don't display "type" column)Based on the DB, then, create a java.util.List that would have the column names in the order they want... (not real code...)
    ArrayList columnOrder = ["title", "number"]
    When you get to iter_tag:table.doStartBody, then create a java.util.HashMap (lets say) called tableColumnData.
    Then in the iter_tag:column tag, you would the value provided in the tag mapped to the property name as the key in the tableColumnData map:
    tableColumnData.put("number", <this iteration's number value>);
    tableColumnData.put("title", <the value returned from the g:href tag>);
    tableColumnData.put("type", <anything>);
    Then, in the iter_tag:table.doEndBody, you do a loop, getting the name of the column to display from the columnOrder list, and using that name to pull the value out of the tableColumnData map:
        for (int i = 0; i < columnOrder.size(); i++) {
            out.println("<td>" + tableColumnData.get(columnOrder.get(i)) + "</td>");
        }You would put the columnOrder in a scope where you won't have to relaod it all the time, like maybe the user's session. You would put the tableColumnDataMap to make sure it is unique to the table... either in the pageContext, or store it in the iter_tag and make a method where the nested tags can retrieve it.

  • Help with placement of div tags

    Hello.  I am sorry to ask what probably is a dumb question, but I'm new, using Dreamweaver CS5, and I need some help.  I'm sure I'll be posting here a few times during this process of building a new site, but I'm hoping it can be a good way for me to learn.  I've watched a lot of tutorial videos, and so here I am.
    I have my site, but I'm having problems being able to place div tags.  I set it up with a wrapper div, a header div, a content div, footer div, etc.  But, inside those divs I want to have other div's where I can place things like a client login box, etc.  So, I tried and tried to place them after one div, or before one, but I just can't get them to work right.  I'm very proficient at Photoshop, but web work is fairly new.  I've done a few sites, but in Golive and just basic bringing them in from Photoshop.  Now I want to learn correctly, so I'm trying all of this.
    I found a way to make a box, using AP Div tag, and then move that where I want it, but, it doesn't work right for me then.  I don't want it fixed in the same spot absolutely, but rather I want it to move with the page.  I'm going to post a link to the site I'm working on, in case that helps.  But, if you look at the site so far, you can see for example I want the text box that says client login to move as you make the page wider or smaller.  It's fixed now.  But, it's the only possible way I know how to put the box and div tag where I want it.  When I just try to insert a div tag (not an AP div) it just goes underneath the div above it.
    What I'm asking is, how do I place div's within div's?  Or, can I use this AP div to put it where I want, and then change it to a regular div, and it stay in the right spot?  I just don't understand how exactly to place divs where I want them, unless I use the AP div box and move it around the screen.  Also, if I have a div box setup, is there a way to drag it somewhere else or reposition it somewhere else on the screen just by dragging?  It's all a bit hard for me to figure out at this point, but I appreciate any help you can give me.
    The AP Div I used is at the top that says client login.  That's the box/table/div tag I'm trying to set up correctly, so it moves with the other elements, like the logo, as you make the page wider or less wide.
    Here is the link:
    http://www.gagephotography.com/boudoir/boudoirsite/index4.html
    Thank you again.

    DW is not drag & drop friendly like graphics or word processing apps.
    APDivs are NOT for primary layouts.  They are for special situations and should be handled with care or you'll end up with a mess.  Here is why:
    http://apptools.com/examples/pagelayout101.php
    The best advice I can offer is to familiarize yourself with HTML markup (content) and CSS (styles) before you even open Dreamweaver.   Without a working knowledge of code, you're not going to get good results.
    Start here:
    HTML & CSS Tutorials - http://w3schools.com/
    Learn CSS positioning in 10 Steps
    http://www.barelyfitz.com/screencast/html-training/css/positioning/
    How to Develop with CSS?
    http://phrogz.net/css/HowToDevelopWithCSS.html
    New DW Starter Pages --
    http://www.adobe.com/devnet/dreamweaver/articles/introducing_new_css_layouts.html
    Creating your first web site in DW CS5 -
    http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt1.html
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • Need to remove additional markup around components in preview/ publish

    Hi all,
    I have a quick question concerning the cq:noDecoration property on a
    component that - if set to "true" - removes the <div> markup from a
    component.
    I need this behaviour because the markup produces invalid HTML. But
    sadly when removing the wrap the component can not be selected any
    more?
    How can i create a component that has no additional markup wrapped
    around it but can still be edited/selected?
    It would be ok to have additional markup in edit mode but not in
    preview mode.
    Regards,
    Shelly

    how does the markup produce invalid HTML? i am interested to see the validator results for your specific case.
    nevertheless, the WCM Editables (hover frames for opening the edit dialog) require a block element to wrap themselves around per paragraph or component, otherwise they don't know where to attach. this is usually done with the auto-generated div. disabling the decoration effectively disables the editables.
    would it help if you could set your own HTML decoration? using a component's cq:htmlTag node (with e.g. a property cq:tagName = "myhtmlelement" [e.g. h1] and "id" or "class" to set desired style reference) you can maybe produce HTML that conforms to your needs, while at the same time serving as the required surrounding block level element for the editables.
    the ultima ratio is to manually call the CQ.WCM.edit widget function to create an editable within your component's JSP within a block level element:
    <div class="blah">
        ... my magic ....
    <script type="text/javascript">
    CQ.WCM.edit({"path":"/content/geometrixx/en/jcr:content/par/image","dialog":"/libs/foundat ion/components/image/dialog","type":"foundation/components/image","csp":"homepage|page/par |parsys/image|parbase","editConfig":{"dropTarget":[{"id":"image","name":"./fileReference", "accept":["image/.*"],"groups":["media"],"params":{"./sling:resourceType":"foundation/comp onents/image","./imageMap":"","./imageRotate":"","./imageCrop":""}}]}});
    </script>
    </div>
    replace the configuration properties of the .edit function above as needed for your component. see the widget API documentation at [0] for the .edit function.
    you can find various different samples at e.g. (or by looking at the HTML source of an author geometrixx page):
    /libs/dam/components/video/profile/profile.jsp
    /libs/cq/replication/components/staticagent/staticagent.jsp
    [0] http://dev.day.com/docs/en/cq/current/widgets-api/index.html?class=CQ.WCM

Maybe you are looking for

  • HP Omen 15-5000na Wireless is absolutely unusable

    Last month I purchased an Omen 15-5000na from a local reseller. The unit I got, out of the box, was registering "ghost" touches around the bottom left corner of the screen, which other customers are also reporting, and was sent for RMA the next day.

  • Console Launcher Error **X-Fi ExtremeMusic

    i am wondering if anyone gets this error or if any one has fixed it.........Ok heres the deal?I got Vista and installed the CD that came with my sound card. I could hear sound after the installation and when ever I would go to my PC components it sho

  • Where can I see a sample iBook.

    I do not have any other Apple device but an iMac (running 10.6.8).   I do not want to upgrade or (yet) buy an iPad. So where (using my iMac) can I find a typical iBook to examine and determine what should be my target in terms of preparing my own nov

  • I pad screen went black

    I was playing temple run when my I pad 2 screen starting flashing every couple seconds and then went completely black. The only thing that works is when I tap the top n bottom button for a screen shot. When I do this it flashes normal but the colors

  • Photoshop CS3 tool palette submenus appearing on single click (isntead of click + hold), how can I disable this?

    Sometimes I happen to click on tools instead of using the hotkey, if it feels convenient or whatever.  However, on my work machine I'm having a problem where a single click opens up the submenu for whatever tool I clicked on.  For example, I click on