Created

Apr 18, 2013

Modify the auto-generated DIVs using cq:htmlTag

Posted by Vianney Baron

Out of the box AEM creates a number of div tags in the HTML code, these are used by the editing system, but also to identify the various components in the DOM.

As a designer you want to make sure the HTML presented to the end user complies to what you originally put together, so these generated elements can often be seen as a nuisance.

However there are a few ways to work around this, one of them is to use the cq:htmlTag node as described in this post.

First off we need to create a new node in the component definition name cq:htmlTag like so:

file

Then in this node we can define:

  • The class(es) associated with our element, note that CQ always adds one class named after the cell name of our component in the page.
  • The ID added to the element.
  • The actual nature of the tag that will be used to represent our component in the DOM (div, span, p, etc.)

For example this:

file

Will embed the component in the following piece of HTML:


Of course you should be careful when using this feature, as wrong choices might result in a broken DOM and impact both the editing system and the final resulting HTML. 

COMMENTS

  • By Cuci Sofa - 2:17 PM on Apr 04, 2014   Reply
    Thanks.
    • By Paket Pernikahan - 4:29 AM on Apr 06, 2014   Reply
      i really to say nice tools from adobe. i like it.
      • By Paket Pernikahan - 4:39 AM on Apr 06, 2014   Reply
        i really to say nice tools from adobe. i like it.
        • By surf wallpaper - 9:59 AM on Apr 09, 2014   Reply
          Nice information. Thank you for sharing it with us!
          • By online allure michael fiore system reviews - 11:40 AM on Apr 12, 2014   Reply
            Online Allure: Michael Fiore Reveals His Ultra-Clever Online Tactics To Get Great Men Swarming To Your Online Profile Like Bees To Honey.
            • By read more at rebelmouse - 3:38 PM on Apr 18, 2014   Reply
              The Secret Survey: Michael Fiore Releases His Coveted Survey Results That Expose The Real Reason Men Lie (Even To Women They Love) And The "Hidden In Plain Sight" Indicators That Reveal How A Man Really Feels About You
            • By Short Layered Hairstyles - 4:36 PM on Apr 10, 2014   Reply
              Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Please keep it up!
              • By Elena Peterson - 2:23 PM on Apr 16, 2014   Reply
                Permanently Beat Bacterial Vaginosis: Proven 3 Day Cure for Bacterial Vaginosis Freedom, Natural Treatment That Will Prevent Recurring Infection and Vaginal Odor Women's Health Expert Series.
              • By pengertian kebugaran jasmani - 6:28 AM on Apr 15, 2014   Reply
                i love this content
              • By Watch Movie Online Without Downloading. - 4:34 PM on Apr 04, 2014   Reply
                Nice information for<US>Today
                • By Best Vitamin C Serum - 11:40 AM on Apr 12, 2014   Reply
                  Vitamin C is highly unstable. It is sensitive to light, temperature, oxidizing agents, pH and likely to interact with other ingredients.
                • By leite de soja ades - 8:42 PM on Apr 04, 2014   Reply
                  Design is the fundamental soul of a man-made creation that ends up expressing itself in successive outer layers of the product or service. The iMac is not just the color or translucence or the shape of the shell. The essence of the iMac is to be the finest possible consumer computer in which each element plays together.
                  • By Karma koin generator - 11:39 AM on Apr 12, 2014   Reply
                    Free Karma Koin codes lets you purchase items for your games and other objects you desire from other websites that accepts Karm Koin.
                    • By Tinnitus Miracle Pdf - 2:24 PM on Apr 16, 2014   Reply
                      This Tinnitus Miracle review covers the origins of this treatment guide, and also why it is so successful in curing even extreme cases of tinnitus.
                      • By Cheap Flower Delivery - 3:38 PM on Apr 18, 2014   Reply
                        Cheap Flower Delivery 20% Off Today! Send Discount Flowers -Satisfaction Guarantee. Quality Flowers, Cheap flowers delivered! Same Day Delivery!
                        • By Cheap Flowers Delivered Uk - 3:38 PM on Apr 18, 2014   Reply
                          Cheap Flowers Delivered - FREE UK Delivery and FREE Chocolates! Great quality fresh flowers starting from UK - Delivered..
                        • By Jasa SEO - 3:55 AM on Apr 05, 2014   Reply
                          Many Thanks.
                          • By Hydrographics - 11:41 AM on Apr 12, 2014   Reply
                            Hydrographics or HydroGraphics, also known as immersion printing, water transfer printing, water transfer imaging, or cubic printing, is a method of applying printed designs to three-dimensional surfaces.
                            • By Je Oude Telefoon Inleveren Voor Geld - 2:23 PM on Apr 16, 2014   Reply
                              On this page you will find the latest offers and tests for a mobile phone and / or SIM-only subscription. You're looking at old phone handing media market, here we have unfortunately no consideration written about.
                            • By Jasa SEO - 3:25 PM on Apr 05, 2014   Reply
                              Thanks.
                              • By Cap Kaki Tiga Setia Manfaat - 3:13 PM on Apr 06, 2014   Reply
                                Thanks.
                                • By Rocket Chinese - 6:50 PM on Apr 06, 2014   Reply
                                  Learn Chinese Online with Rocket Chinese. Learning Chinese is easy with the Rocket Chinese Premium audio course, learn Chinese software, and Chinese language lessons.
                                • By Apartments For Sale In Bannerghatta Road - 6:51 PM on Apr 06, 2014   Reply
                                  Search Apartments Flats in Bannerghatta Road, Apartments for Sale in Bannerghatta Road, Residential Flats in Bannerghatta Road at Sulekha Property...
                                  • By Vitamin C Skin Serum - 6:51 PM on Apr 06, 2014   Reply
                                    Vitamin C Skin Serum is great for supporting skin healthy by boosting collagen production. This homemade serum helps skin repair itself and brightens skin.
                                    • By Anti Aging Serum - 2:14 PM on Apr 07, 2014   Reply
                                      Best Anti Aging Serum For Your Face - Isabis Formulae Topical Vitamin C Serum. Maximum Protection of your skin against free radicals that cause premature aging, Stimulates New Collagen Production, Brightens and Lightens skin for more Even Skin Tone.
                                      • By Vitamin C For Face - 2:14 PM on Apr 07, 2014   Reply
                                        Vitamin C For Face & Skin Serum is quickly absorbed and tightens & rejuvenates aging sagging skin. Gives EXTRA help for skin that is dry, sun damaged, prone to blackheads, acne and rosacea.
                                        • By Michael Fiore Text Your Ex Back 2.0 - 2:15 PM on Apr 07, 2014   Reply
                                          Michael Fiore releases version 2.0 of his super popular Text Your Ex Back system and the gang over at the Text Your Ex Back Forum has you covered. Keep reading to get the scoop on the latest version of Mike's texting guide and learn how to get your ex back using text messages...
                                          • By ASUS Notebook Terbaik dan Favoritku - 3:43 AM on Apr 08, 2014   Reply
                                            small tag is very influential in a html. to get a good design is the preferred colors. above explanation is very helpful, thanks to all my friends.
                                            • By Antioxidant Serum - 7:07 PM on Apr 08, 2014   Reply
                                              Best Anti-Aging Skin Care - Vitamin C Serum 20 % Includes Vitamin A & E For Superior Anti-Wrinkle Results - Isabis Formulae Advanced C-Serum Delivers Smoother, Brighter & Younger Looking Face & Skin.
                                              • By Fibroids Miracle Pdf Download - 7:08 PM on Apr 08, 2014   Reply
                                                Great post I would like to thank you for the efforts you have made in writing this interesting and informative article.
                                                • By Best Face Serum - 7:08 PM on Apr 08, 2014   Reply
                                                  Isabis Formulae Topical Vitamin C Serum, Maximum Protection of your skin against free radicals that cause premature aging. Stimulates New Collagen Productionand Brightens and Lightens skin for more Even Skin Tone.
                                                  • By Amazon fire TV Unbox review - 2:56 AM on Apr 10, 2014   Reply
                                                    I look that you give great information forus Today
                                                    • By Pakar SEO - 11:35 AM on Apr 10, 2014   Reply
                                                      Thanks.
                                                      • By Peluang Usaha Waralaba Loundry Kiloan - 9:35 AM on Apr 11, 2014   Reply
                                                        Thanks.
                                                            • By 5-htp - 11:34 AM on Apr 11, 2014   Reply
                                                              An HTML element is an individual component of an HTML document or "web page", once this has been parsed into the document object model. HTML is composed of a tree of HTML elements and other nodes, such as text nodes. Each element can have HTML attributes specified. Elements can also have content, including other elements and text.
                                                                    • By cap kaki tiga, setia, manfaat - 1:44 PM on Apr 11, 2014   Reply
                                                                      Thanks
                                                                      • By Strategi Pemasaran - 4:58 AM on Apr 12, 2014   Reply
                                                                        Thanks.
                                                                        • By Airul - 5:53 AM on Apr 12, 2014   Reply
                                                                          Thanks.
                                                                          • By Tidung - 6:29 AM on Apr 12, 2014   Reply
                                                                            Thanks.
                                                                            • By Alfa laval - 3:00 PM on Apr 13, 2014   Reply
                                                                              Industrial Trading Company Limited has over fifty years experience as a stockist and distributor of precision engineering components to a wide number of markets and sectors.
                                                                              • By Precision gears - 3:00 PM on Apr 13, 2014   Reply
                                                                                Reliance Precision is a specialist engineering company, with over 50 years' experience in providing custom-built, high reliability, precision instrumentation to customers from a diverse range of global markets.
                                                                                • By Debt Management - 3:00 PM on Apr 13, 2014   Reply
                                                                                  Debt Management Plans to suit your wallet. We could help you lower your payments by up to 70%. Get in touch today for a free consultation.
                                                                                  • By Carpet Coatings - 3:01 PM on Apr 13, 2014   Reply
                                                                                    Formulated Polymer Products was established in 1988 and has grown rapidly to become a leading supplier of custom formulated speciality latex compounds.
                                                                                    • By Climate Environmental - 3:01 PM on Apr 13, 2014   Reply
                                                                                      With more than 40 years' experience in the industry, you can be sure that Climate Environmental Ltd has the answer. Call us today for a free survey and quotation and we will create a design that suits you perfectly.
                                                                                      • By Loud Speakers - 3:02 PM on Apr 13, 2014   Reply
                                                                                        THE TECHNOLOGY: Musical instruments such as pianos, violins and guitars produce music by creating vibrations in their wooden soundboard. Amina Technologies uses the same principles to produce pure and natural sound in our flat panel speakers.
                                                                                        • By PCB Layout - 3:02 PM on Apr 13, 2014   Reply
                                                                                          A technology company with over 35 years experience in PCB design, PCB assembly and PCB manufacturing, providing flexible EMS resources with a professional and personal service.
                                                                                          • By Fireworks Displays - 3:02 PM on Apr 13, 2014   Reply
                                                                                            Welcome to the vibrant and exciting world of Pyrotex Fireworx. Professional Fireworks and Fireworks For Sale http://www.pyrotexfireworx.co.uk Create spectacular displays for birthdays, Bonfire Night - November 5th, Diwali, Anniversaries.
                                                                                          • By Water Jet Services - 3:03 PM on Apr 13, 2014   Reply
                                                                                            Wightman Stewart Waterjet ltd, the UK market leader in plate and fabrication technology is based in Ripponden, near Halifax, West Yorkshire.
                                                                                            • By Fire Safety - 3:03 PM on Apr 13, 2014   Reply
                                                                                              Fire Safe International has provided high quality products and services since it's inception in 1993. Our staff have a wealth of experience and expertise in many areas of fire saftey and we pride ourselves in providing bespoke equipment and training services.
                                                                                              • By Traffic Safety Management Services - 3:03 PM on Apr 13, 2014   Reply
                                                                                                TSM is dedicated to achieving consistently high standards, providing solutions to road traffic management requirements across the UK.
                                                                                                • By Packaging Services - 3:04 PM on Apr 13, 2014   Reply
                                                                                                  See what Oyster UK (oysternottingha) has discovered on Pinterest, the world's biggest collection of everybody's favorite things.
                                                                                                  • By Cleaning Services - 3:04 PM on Apr 13, 2014   Reply
                                                                                                    TCMS (Midlands) Ltd have been offering a professional service for over 30 years to the commercial sector. We pride ourselves on our ability to deliver quality standards to cater for our customer’s needs.
                                                                                                    • By Pit Bikes - 3:04 PM on Apr 13, 2014   Reply
                                                                                                      Pit Bikes UK - Importers, wholesalers and retailers of £329Dirt Bikes, £339 Pit Bikes, Kid's Quads £599 and 125cc or 110cc Pit Bikes & Dirt Bikes. We also offer full PARTS BACK UP and fast delivery from our pit bike shop to anywhere in the UK & Ireland.
                                                                                                      • By Tools - 3:05 PM on Apr 13, 2014   Reply
                                                                                                        A P Tools Ltd supply the No 1 industrial tooling brands to the Aerospace, Manufacturing, Engineering and Composite industries around the world.
                                                                                                        • By Wax - 3:05 PM on Apr 13, 2014   Reply
                                                                                                          Initially established in 1962 Kerax are experts in wax and wax blending. We supply extensive and comprehensive ranges of all waxes and wax blends and are large scale producers of petroleum jellies for pharma, cosmetic, industrial and commercial use.
                                                                                                          • By Lubricant Suppliers - 3:06 PM on Apr 13, 2014   Reply
                                                                                                            Lubricant Suppliers, Lubricant Manufacturers, Lubricant Companies, Lubricant Exporters And Lubricant Importers In Europe.
                                                                                                            • By Accountants - 3:06 PM on Apr 13, 2014   Reply
                                                                                                              Nicholas Cliffe & Co. Limited are a small, dynamic and very personal firm of chartered accountants, with a record over more than twelve years of offering prompt, efficient service and demonstrably useful advice.
                                                                                                              • By Alarm Systems - 3:14 PM on Apr 13, 2014   Reply
                                                                                                                Tecserv uk provide fire and security solutions for commercial, industrial and prestige buildings across the UK. We ensure the best products and service levels to meet the particular requirements of every customer site. We understand that 'one size' simply.
                                                                                                                • By limescale Removal - 3:15 PM on Apr 13, 2014   Reply
                                                                                                                  Unlike water softeners and detergents, the Water Imp magnetic water conditioner does not require constant application. Just turn the unit on, and leave it... it's that simple.
                                                                                                                  • By UPS Systems - 3:16 PM on Apr 13, 2014   Reply
                                                                                                                    Cetronic Power Solutions is an ISO9001 accredited company and provides engineering solutions to electrical power problems. The Cetronic name has been synonymous with solving electrical power problems since 1966 and offers a range of products.
                                                                                                                    • By Mattresses - 3:19 PM on Apr 13, 2014   Reply
                                                                                                                      We currently have two branches, One in Gadebridge, Hemel Hempstead and one in Marshalswick, St Albans. At Bedknobs we pride ourselves in the very best quality of service and Excellent value for money.
                                                                                                                      • By Catering Services - 3:20 PM on Apr 13, 2014   Reply
                                                                                                                        Welcome to BE catering, we are an energetic, creative and professional catering company in Birmingham with over 20 years experience within the catering and hospitality industry.
                                                                                                                        • By Kitchen Designers - 3:21 PM on Apr 13, 2014   Reply
                                                                                                                          Hog’s Back Associates Limited is a successful business selling built- in kitchen appliances, specialist free standing appliances and kitchens in Surrey and the Surrounding areas..
                                                                                                                            • By Erwin Pratama - 3:57 PM on Apr 14, 2014   Reply
                                                                                                                              Nice Work
                                                                                                                              • By Paleo Vegan Recipes - 6:59 PM on Apr 16, 2014   Reply
                                                                                                                                Thanks.
                                                                                                                                • By 188bet - 9:26 AM on Apr 18, 2014   Reply
                                                                                                                                  Limited are a small, dynamic and very personal firm of chartered accountants, with a record over more than twelve years of offering prompt, efficient service and demonstrably useful advice.
                                                                                                                                  • By BTV IPTV - 4:26 PM on Apr 18, 2014   Reply
                                                                                                                                    Did you ever hear television through Access to the internet!!! it truly sound to become wonderful!! Therefore, now you might avoid the problems and hassle that are faced for that reason associated with any intermediary. It holds true that odds are quite bright if you're sensibly acquainted with IPTV companies. <a href"=http://www.incrediblefta.com/item/885/1/1/btv-hd-iptv-receiver.html">BTV IPTV</a>
                                                                                                                                    • By amway polska - 6:21 PM on Apr 18, 2014   Reply
                                                                                                                                      A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up.
                                                                                                                                      • By amway polska - 6:21 PM on Apr 18, 2014   Reply
                                                                                                                                        I definitely enjoying every little bit of it It is a great website and nice share I want to thank you Good job! You guys do a great blog, and have some great contents
                                                                                                                                        • By amway polska - 6:23 PM on Apr 18, 2014   Reply
                                                                                                                                          This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
                                                                                                                                          • By mieszanka orzechów - 6:23 PM on Apr 18, 2014   Reply
                                                                                                                                            Excellent publish from specialist also it will probably be a fantastic know how to me and thanks very much for posting this useful data with us all.
                                                                                                                                            • By migdały - 6:24 PM on Apr 18, 2014   Reply
                                                                                                                                              The author of this post must be very excellent. Great post actually. Thank you very much indeed for sharing this post. To tell the truth, I really really like it.
                                                                                                                                              • By amway polska - 6:24 PM on Apr 18, 2014   Reply
                                                                                                                                                Thank you for posting the great content. I was looking for something like this. I found it quiet interesting, hopefully you will keep posting such blogs. Keep sharing
                                                                                                                                                • By amway polska - 6:25 PM on Apr 18, 2014   Reply
                                                                                                                                                  Thanks for taking the time to discuss about this, I feel strongly about it and love learning more on this topic. If possible, would you mind updating your blog with more information? It is extremely helpful for me.

                                                                                                                                                  ADD A COMMENT