The Block ID property gives a unique identifier to your block.
It can act as a named anchor. You can therefore create an anchor link that takes you to the desired element
It can also act as an identifier for Cwicly to allow targeting the block for specific actions
The Block ID attribute must be unique to the page. A block can only have one Block ID.
- Select a block
- Open the Block Inspector
- Find ID/Class field.
- Click ID/Class to Toggle ID.
- The field will now show the Block ID.
The Block ID for the selected block should always be unique. Multiple identical Block IDs in a page will invalidate your website.
Whenever you insert or create a block, a unique Block ID is automatically created and applied to the element.
That's it! Cwicly doesn't rely on user ID creation, preferring to have a unique ID created for every block.
IDs must start with a letter
IDs should be descriptive
IDs must not contain space characters
Since IDs are specific to each block, modifying their name will have to be done via the block they are related to.
- Select a block.
- Double click the Block ID name in the field.
- Input new name as required.
Make sure that the new name is unique.
Since Block IDs are bound to a specific block, removing that block will automatically remove the Block ID from your website.
Make sure to remove any link that contains the block ID before removing it from your website.
By default, Cwicly shows all classes and IDs but this the Remove Classes and IDs toggle can be toggled on from the Cwicly Advanced Settings. A class will automatically show when styles are applied to the block.
Global classes added are automatically updated without needing to refresh
- Open Cwicly Settings in the WordPress Dashboard.
- Find Cwicly Optimisations in the Advanced Settings tab.
- Toggle on Remove Classes and IDs.
A Show/Hide toggle is provided to allow you to have the class/ID appear on the frontend even if there are no styles applied to the block.
This is because block classes and IDs don’t appear by default on the frontend.
Only when styles have been added at the block level will the class will appear.
If you already have styles applied, toggling the class won’t do anything.
- In the Block Inspector, navigate to the Block ID.
- To the right of the Block ID field, toggle on the "Dot".
When it is toggled on, the dot becomes green.
An indicator next to ID indicates that the ID has been applied.