Accessing the unique numbering of cornerstone elements in custom elements

For V2 elements, there are automatically generated classes added to each element, such as e710-22 for an element on page id 710, the 22nd element rendered.
In the element rendering files, this seems to be referred to as $mod_id, and is stored sometimes in the post_content as an attribute to the shortcode as “_id”.

Is there a way to use this generated ID in custom (classic) elements?

The numbering system currently does seem to count classic elements as well as V2 elements, but I couldn’t see a way of referencing it from my custom element shortcode.php template, as simply referencing $mod_id doesn’t work, and neither does trying to access $_custom_data, which is referenced by V2 element view templates.

Alternatively, do you have any update on implementing a V2 Element API to allow custom V2 elements? It would be great to have this available in order to make use of some of the great V2 features, but with the customisation of self-developed elements.

Hi There,

Thanks for writing in! Regretfully, this particular customization request is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself.

Thank you for your understanding.

HI friech, thanks for the response.

Instead of this then, is there currently an API / documentation being developed for creating custom V2 Elements? I have seen mention that this was being worked on in other discussions on the forum, but some of these date back quite far so I’m wondering if there’s an update on this front?

Cheers

Hey @arthurodb,

There’s currently no API available yet but we have a general guide here about creating your own elements. Just note that this is not a part of our support service.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.