4
Answers
Vote up!
1
Vote down!

Finding the source of generated html code

Anyone have any idea on the best way to see what module is generating what html source code? For example, I'd like to add Lightbox2 to an anchor tag that is produced by going to Store>Products and creating a product but I can't find the file where this html is generated. So, while my question is based on finding the answer for this scenario, in a more general sense, I'm wondering if there is a way to find out where given html comes from.

Thanks and I apologize if this has been covered elsewhere (I looked but could find nothing on this).

New to Drupal
SC

Asked by: fretwizz
on June 6, 2012

4 Answers

Vote up!
1
Vote down!

Hey Fretzizz,
I'd look into using the display format that are provided with modules like colorbox. I'm not as familiar with the lightbox module and if it has this option, but it probably does. To select a different display format go to: Store > Products > Product Types (tab) > Manage Display. Then you can change the format drop-down for your product photo from image to colorbox or another format. Once you set the format you can adjust the settings for images styles by clicking the gear icon on the right of the row. This method allows you to manage everything to the GUI without having to mess with template files.

Andy Giles
Answer by: Andy Giles
Posted: Jun 6, 2012
Vote up!
0
Vote down!

Thanks for the help! I figured it wasn't going to be much different than Wordpress in this respect but as a new user I wasn't sure. I'd like to add a class used to initiate Lightbox 2 on an anchor tag that appears when I create a content type of product. A few nested divs get created and, presumably, Commerce adds classes to them... inside of these div is an anchor tag I'd like to add my class to. The parent div to the anchor tag has a class of "field-item even". All I did was create a product in the Commerce Store and then create a node of content type "Product display". I would like the image I added to the Product created in the store to open a Lightbox when clicked. I'm aware of the 'don't mess with core' concept... if there is another way to do what I want I'd just as soon do that but this seems to be a pretty good way to always have this kind of functionality. I'm having a heckuva time trying to find out where code is generated from, thought;)

Thanks again,
SC

Answer by: fretwizz
Posted: Jun 6, 2012
Vote up!
0
Vote down!

Yeah, I looked in their (thinking this was the 'Drupal way') but I didn't see any options there after installing LB2. Thanks for the suggestion, though;)

SC

Answer by: fretwizz
Posted: Jun 6, 2012

Comments

Hey Fretwizz,
I was currious about your issue, so I installed LightBox2 on a base commerce kickstart installation. I updated the display format as I described previously (there are a ton of options for lightbox). Here is an example http://dc.digitalporch.net/node/3 . Clicking the image opens a lightbox, are you trying to accomplish something else?

- Andy Giles on June 6, 2012

Hey SC,
I installed LightBox2 and updated the display format as I suggested in my answer and it worked. There are a lot of options added to the display format once LightBox is installed. Here is a demo: http://dc.digitalporch.net/node/3 . Is that what your trying to accomplish or something else?

- Andy Giles on June 6, 2012
Vote up!
0
Vote down!

I made an error in the last entry, I did find LB2 under "Format' for "Image" in the "Manage display" area. Thanks for all the help! Despite this, I'm still on a quest to find out how to do this the way I first mentioned as I'd like to be able to make changes this way if needed. In looking, and with the help of answers above, I did figure a lot of things out.

Once again, thanks to all!
SC

Answer by: fretwizz
Posted: Jun 7, 2012