Replies: 3 comments
|
Went looking for evidence on the six questions. Most of them turn out to be answerable from what Proclaim already has, so here is a concrete proposal rather than more options. Q1 — per template, and here is why that is not a close call
`params` LONGTEXT,
`location_id` INT(3) DEFAULT NULL,
KEY `idx_template_location` (`location_id`)So a CSS param on a template is per-campus CSS, with no new plumbing and no new concept for an administrator to learn — it follows the multi-campus model that already exists. @bcordis's instinct that this belongs in template settings holds up on inspection. I would still add a component-level sheet in Q2 — params, not a file. Three independent reasonsBackup. The media directory is component-owned. '/media/com_proclaim/css/icons.css',
'/media/com_proclaim/css/bsmImport.css',
'/media/com_proclaim/css/general.min.min.css',
...Putting user-authored content into a directory the installer actively prunes invites exactly the update-time loss we are trying to fix. The asset manifest is generated. Q3 — the update story, which is the whole pointParams live in Q4 — security: a content surface, not a new privilegeAuthoring would require Two things still worth doing, because CSS is not inert:
Q5 — complements Template CodesTemplate Codes stays for structural overrides. What should change is the documentation: Q6 — the one I cannot answer from the codeWhich problems people actually reach for CSS to solve. Some are probably Layout Editor settings that already exist or should. Without that, we risk building a general escape hatch for a set of specific gaps. This is the question I would most like input on — a handful of real "I had to write CSS because…" examples would shape the default styling more usefully than any amount of design here. Proposed shape
The one genuine tradeoff leftInline The alternative — write the params to a generated file on save and load that — buys caching but reintroduces the writable-directory problem and needs a fallback when the directory is not writable. My suggestion is to start inline, and revisit if anyone produces a sheet large enough to matter. Being wrong about that is cheap and reversible; being wrong about params-vs-file is not. What I would want agreed before implementing
1 and 2 are the ones that change the code. |
|
Built it — #1725. Both levels, inline to start, as agreed.
Component sheet loads first so a template refines it rather than replacing it. Emitted once per request from the site Two things worth reporting back here rather than leaving in the PR. The site-wide sheet went to The All seven are in a data provider, and neutering the sanitiser fails all seven. Verified live on j6-dev with a sheet containing
Q6 is still the open one, and it is the one that would change what we build next. Which problems do people actually reach for CSS to solve? Some are probably Layout Editor settings that already exist, or should. A handful of real "I had to write CSS because…" examples would tell us whether this escape hatch is the fix or a symptom. The other thing to revisit eventually is inline-vs-file. Inline is not browser-cacheable and re-sends on every page — fine for a few dozen rules, wasteful for a large one. Worth changing only if someone produces a sheet big enough to matter, which is exactly the kind of thing those examples would surface. |
|
Closing this out. The two questions it existed to settle — Q1 per-template vs global, and Q2 params vs file — were both decided and are both shipped, which is what this said would resolve it. What shippedThree levels, not the two reported above. The per-section level landed later in #1817 and was never written up here:
Site-wide and template sheets are emitted once per request from The section level is worth a note because it solves something the original design did not address: the two page-wide sheets could not style one section of a landing page without hand-writing a selector against markup that might change. Each section's CSS is now wrapped in Against the original questions
The one open tradeoffInline One thing that came out of this laterIn #843, custom CSS turns out to be what makes params-only template presets viable: a preset can carry |
Uh oh!
There was an error while loading. Please reload this page.
Split out of #1653. While auditing per-section permissions we found
csseditdeclared inadmin/access.xmlsince the original 2013 ACL pass, guarding a CSS editor that was never built. Rather than keep a permission for a phantom feature, the section was dropped — but the underlying gap is real and worth designing properly.Where custom CSS stands today
There is no supported mechanism. The options a site owner actually has:
.phpfiles into the view folders. Its own help text says "Put the php and HTML code here… Put in your own CSS tags too." So custom CSS ends up inline in a PHP override.media/css/, which an update overwrites.None is good. (1) mixes presentation into a code override and needs someone comfortable with PHP; (3) actively loses work on update. The realistic outcome is people hacking files that get overwritten.
The proposal on the table
@bcordis's initial read is that this belongs in template settings rather than as a separate editor screen, which has a lot going for it — Proclaim templates already carry the presentation params (
pagination_style,listing_item_style,embedshare), so styling decisions are already made there, and per-template CSS follows the multi-campus model where different campuses run different templates.Sketch, to argue with:
!importanttemplatesection, so no new ACL section is neededOpen questions
url()and injected content, is not entirely inert. It would be authorable only by someone who can already edit templates, but worth stating.What would resolve this
A decision on 1 and 2, which determines everything else. Once there is a shape, it becomes an issue with an implementation plan — and if it ships as its own manageable thing rather than a template field,
csseditearns its ACL section back, honestly this time.All reactions