admin view header custom code not linked text is not compiled #468
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#468
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
custom code the admin view header template: insert and
compile
Expected result
all translated text
Actual result
not linked (it means not sortable), so not inside tags, header placeholders not translated
linked placeholders are correctly translated
System information (as much as possible)
Additional comments
Hmmm, I am not sure I get what you are trying to do.... you will need to explain more.
Say I want to customize the header of a list view, in admin side.
I just set the custom codes (<!— [REPLACE<>$$$$]—> and <!— [/REPLACE<>$$$$]—>) in default_header.php file, save, compile, upload. Just this.
The column titles which are not sortable (haven’t the a tag) are not compiled, it means instead of translation there is the text: COM_[[[COMPONENT]_HEADER_TEXT
Custom code does not work on one line, you must replace a few lines, and not close to eachother.
Why don't you change the TAB names in JCB?
This is in the settings tab of an admin-view.
There is a misunderstand..
I’m referring to the header of a content list view:
hmmm that does not help... content list view? where is that. If you watch the tutorials I use terms to idetify things and if you use different terms I can't follow seeing there is like just way to many thinks on the table here.
Far as I understand tabs are used in the admin_view and dashboard of components build with JCB if you are adding more dashboard tabs... then this is also done in JCB and not needed to use custom insert/replace code. If you are adding tabs in and admin_view (edit) view then this also is done inside JCB as explained above.
Yet you are saying in the content list view, this sounds like the admin_views but this does not have tabs... so I am still not getting where you are doing this.
:-)
Please note that I haven’t written “tab” in any post.. maybe you read “taG” and thought a tab…
Anyway,
I want to customize the header of a list table (result of a list query), in admin side. There are no tabs! :-)
Being in a table there are columns and rows.
After I set the custom codes (<!— [REPLACE<>$$$$] —> and <!— [/REPLACE<>$$$$] —> the headers that haven’t sorting option are not translated.
Only those like listDirn, $this->listOrder); ?> are translated,
simple echo like echo 'COM_[COMPONENT]_ORDER_SUBSCRIBER_ID_LABEL’ are not translated.
I hope it’s a bit more understandable.
okay... my mistake, we speak about that area as the admin_views or the list view.
Please watch this tutorial as to why avoiding the use of custom code.
Now to change the names of those columns in the table use the admin_fields_relations since you have the option to change the column name from default to anything you want. This is the most ideal place to do this.
Then if you really want to do this with custom code placeholder, you will have to give me the code so I can see what is not working out. Since we know that feature is stable and if it does not work, there is often wrong implementation.
So as example:
Another note, JCB does not target translations stings done in the JHtml, only the following strings are targeted. So what you are trying to do will not work without some tweaking.
try this:
Hope this helps, I have not tested it.
Hello,
Great advice to use "field relations"! That does the trick! Thanks.
About the column headers link, just use your Demo component and follow these instructions:
Open the "Look" admin views in JCB and add a field in the list (I added "alias"), NOT SORTABLE
Compile, upload
Everything works fine
Open default_head.php in your editor and add the replace tags:
4 Compile
5 Upload
6 Go to Looks view
"Alias" is not translated anymore.
Just the "not sortable" fields, sortable fields work fine.
By the way, is there also a way to add CSS to the column headers, like align-right, without custom code?
In the admin_view there is a tab->CSS and a field Add CSS (views) * which targets the list_view of the admin view.
I have pushed a fix to your issue, try out the staging branch on a blank install and see it it is truly resolved.
I know about that tabs to add css code, but, how can I add a style to just 1 column header?
If I set a css style for the th rag, all th are affected, it means all column headers all together. Each th should have an id identifier (perhaps with the field name?).
To do it, right now, I have to use custom code.
I will check your fix soon and give you a feedback.
Thanks!