Bug 8622 - Custom id in custom block plugin
Custom id in custom block plugin
Status: RESOLVED FIXED
Product: OJS
Classification: Unclassified
Component: Plug-ins
2.4.5
All All
: P3 trivial
Assigned To: PKP Support
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-18 22:53 PDT by Andrea Marchitelli
Modified: 2014-08-27 07:57 PDT (History)
3 users (show)

See Also:
Version Reported In:
Also Affects:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Marchitelli 2014-03-18 22:53:51 PDT
If you are using more than one block only, every custom block has an id="custom" that give an HTML error.
Is it possibile to change id to classes or (maybe better) use the name of the blok to generate an id like id="custom blockname"?
Comment 1 Alec Smecher 2014-03-19 12:42:08 PDT
Andrea, the current codebase doesn't have an ID clash -- I suspect you're using something from before this change was committed...

https://github.com/pkp/ojs/commit/107420a3b06150a803026102c4e6f3f968b64441

However, if you're looking to style blocks specifically, then this change won't provide a unique CSS selector. In that case we should probably add the block ID (a numeric value) as a suffix to an ID. Would that suit you?
Comment 2 Clinton Graham 2014-08-13 12:50:39 PDT
I like the id with the blockname as specified by the user, but it would need to be sanitized.
Comment 3 Alec Smecher 2014-08-13 12:52:02 PDT
Pull request opened (not merged):
Add custom block ids; fix escape of custom block name in custom block manager
https://github.com/pkp/ojs/pull/259
Comment 4 Alec Smecher 2014-08-14 14:35:14 PDT
Merged; thanks, Clinton!
Comment 5 Clinton Graham 2014-08-14 14:36:02 PDT
Add custom block ids; fix escape of custom block name in custom block manager.
https://github.com/pkp/ojs/commit/87842437f6f569aa5e542d3c33424756e3b774f7
Comment 6 Alec Smecher 2014-08-14 14:36:02 PDT
Pull request closed (merged):
Add custom block ids; fix escape of custom block name in custom block manager
https://github.com/pkp/ojs/pull/259