admin view header custom code not linked text is not compiled #468

Closed
opened 2019-08-24 08:55:09 +00:00 by jcodewalker · 12 comments
jcodewalker commented 2019-08-24 08:55:09 +00:00 (Migrated from github.com)

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
Schermata 2019-08-24 alle 10 47 08

System information (as much as possible)

  • Joomla Version: 3.9.11
  • JCB Version: 2.10.0

Additional comments

### Steps to reproduce the issue custom code the admin view header template: insert <!---[REPLACE<>$$$$]--> and <!---[/REPLACE<>$$$$]--> compile ### Expected result all translated text ### Actual result not linked (it means not sortable), so not inside <a> tags, header placeholders not translated linked placeholders are correctly translated ![Schermata 2019-08-24 alle 10 47 08](https://user-images.githubusercontent.com/49115855/63634989-9ffe1d80-c65d-11e9-8719-d4107b6e103a.png) ### System information (as much as possible) - Joomla Version: 3.9.11 - JCB Version: 2.10.0 ### Additional comments

Hmmm, I am not sure I get what you are trying to do.... you will need to explain more.

Hmmm, I am not sure I get what you are trying to do.... you will need to explain more.
jcodewalker commented 2019-08-26 06:51:47 +00:00 (Migrated from github.com)

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

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?

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?

image

This is in the settings tab of an admin-view.

![image](https://user-images.githubusercontent.com/5607939/63671412-b7fdaa80-c7df-11e9-82f9-9c54437c9a93.png) This is in the settings tab of an admin-view.
jcodewalker commented 2019-08-26 09:22:37 +00:00 (Migrated from github.com)

There is a misunderstand..
I’m referring to the header of a content list view:

Il giorno 26/ago/2019, alle ore 08:59, {{ǝʍǝ}}yn notifications@github.com ha scritto:

https://user-images.githubusercontent.com/5607939/63671412-b7fdaa80-c7df-11e9-82f9-9c54437c9a93.png
This is in the settings tab of an admin-view.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/vdm-io/Joomla-Component-Builder/issues/468?email_source=notifications&email_token=ALWXFT23ZRLJ4F47HJTJDMTQGN5NVA5CNFSM4IPFUCFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5DOZ7I#issuecomment-524741885, or mute the thread https://github.com/notifications/unsubscribe-auth/ALWXFTZ4QZMJI2FMH5K566TQGN5NVANCNFSM4IPFUCFA.

There is a misunderstand.. I’m referring to the header of a content list view: > Il giorno 26/ago/2019, alle ore 08:59, {{ǝʍǝ}}yn <notifications@github.com> ha scritto: > > <https://user-images.githubusercontent.com/5607939/63671412-b7fdaa80-c7df-11e9-82f9-9c54437c9a93.png> > This is in the settings tab of an admin-view. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/vdm-io/Joomla-Component-Builder/issues/468?email_source=notifications&email_token=ALWXFT23ZRLJ4F47HJTJDMTQGN5NVA5CNFSM4IPFUCFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5DOZ7I#issuecomment-524741885>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ALWXFTZ4QZMJI2FMH5K566TQGN5NVANCNFSM4IPFUCFA>. >

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.

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.
jcodewalker commented 2019-08-26 16:20:20 +00:00 (Migrated from github.com)

:-)
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.

Il giorno 26/ago/2019, alle ore 13:07, {{ǝʍǝ}}yn notifications@github.com ha scritto:

l 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.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/vdm-io/Joomla-Component-Builder/issues/468?email_source=notifications&email_token=ALWXFT4JG3AXH76KWS64P3TQGO2OJA5CNFSM4IPFUCFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5EBRYA#issuecomment-524818656, or mute the thread https://github.com/notifications/unsubscribe-auth/ALWXFT75UVT2DRFJS7TEIHLQGO2OJANCNFSM4IPFUCFA.

:-) 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 <?php echo JHtml::_('grid.sort', 'COM_[[[COMPONENT]]]_ORDER_SUBSCRIBER_ID_LABEL', 'subscriber_id_lname', $this->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. > Il giorno 26/ago/2019, alle ore 13:07, {{ǝʍǝ}}yn <notifications@github.com> ha scritto: > > l 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. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/vdm-io/Joomla-Component-Builder/issues/468?email_source=notifications&email_token=ALWXFT4JG3AXH76KWS64P3TQGO2OJA5CNFSM4IPFUCFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5EBRYA#issuecomment-524818656>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ALWXFT75UVT2DRFJS7TEIHLQGO2OJANCNFSM4IPFUCFA>. >

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:

<!-- [REPLACE<>$$$$] -->
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTNAME_ORDER_SUBSCRIBER_ID_LABEL', 'subscriber_id_lname', $this->listDirn, $this->listOrder); ?>
<!-- [/REPLACE<>$$$$] -->

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:

<!-- [REPLACE<>$$$$] -->
<?php echo JHtml::_('grid.sort', JustTEXT::_('The column name'), 'subscriber_id_lname', $this->listDirn, $this->listOrder); ?>
<!-- [/REPLACE<>$$$$] -->

Hope this helps, I have not tested it.

okay... my mistake, we speak about that area as the admin_view**s** or the list view. Please watch this [tutorial as to why avoiding the use of custom code](https://www.youtube.com/watch?v=QGMURJI_Mds&list=PLQRGFI8XZ_wuzAQELTUUIDdqKFmLP9lSl&index=4&t=0s). Now to change the names of those columns in the table use the [admin_fields_relations](https://youtu.be/hh4IIPmYIY8) 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: ``` <!-- [REPLACE<>$$$$] --> <?php echo JHtml::_('grid.sort', 'COM_COMPONENTNAME_ORDER_SUBSCRIBER_ID_LABEL', 'subscriber_id_lname', $this->listDirn, $this->listOrder); ?> <!-- [/REPLACE<>$$$$] --> ``` Another note, JCB does not target translations stings done in the JHtml, only the [following ](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/admin/helpers/compiler/a_Get.php#L296) strings are targeted. So what you are trying to do will not work without some tweaking. try this: ``` <!-- [REPLACE<>$$$$] --> <?php echo JHtml::_('grid.sort', JustTEXT::_('The column name'), 'subscriber_id_lname', $this->listDirn, $this->listOrder); ?> <!-- [/REPLACE<>$$$$] --> ``` Hope this helps, I have not tested it.
jcodewalker commented 2019-08-27 07:39:41 +00:00 (Migrated from github.com)

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:

  1. Open the "Look" admin views in JCB and add a field in the list (I added "alias"), NOT SORTABLE
    Schermata 2019-08-27 alle 09 32 23

  2. Compile, upload
    Schermata 2019-08-27 alle 09 22 23
    Everything works fine

  3. Open default_head.php in your editor and add the replace tags:
    Schermata 2019-08-27 alle 09 25 10

4 Compile
Schermata 2019-08-27 alle 09 26 06

5 Upload
Schermata 2019-08-27 alle 09 26 53

6 Go to Looks view
Schermata 2019-08-27 alle 09 27 15
"Alias" is not translated anymore.
Just the "not sortable" fields, sortable fields work fine.

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: 1. Open the "Look" admin views in JCB and add a field in the list (I added "alias"), NOT SORTABLE ![Schermata 2019-08-27 alle 09 32 23](https://user-images.githubusercontent.com/49115855/63750536-ed70c980-c8ad-11e9-8524-d99ca549b054.png) 2. Compile, upload ![Schermata 2019-08-27 alle 09 22 23](https://user-images.githubusercontent.com/49115855/63750595-07121100-c8ae-11e9-962a-73fed6ec31ca.png) Everything works fine 3. Open default_head.php in your editor and add the replace tags: ![Schermata 2019-08-27 alle 09 25 10](https://user-images.githubusercontent.com/49115855/63750742-55bfab00-c8ae-11e9-8521-579ae77fca8f.png) 4 Compile ![Schermata 2019-08-27 alle 09 26 06](https://user-images.githubusercontent.com/49115855/63750776-696b1180-c8ae-11e9-9ad1-871dfb3c45c3.png) 5 Upload ![Schermata 2019-08-27 alle 09 26 53](https://user-images.githubusercontent.com/49115855/63750808-74be3d00-c8ae-11e9-817d-8aabfa4f70b0.png) 6 Go to Looks view ![Schermata 2019-08-27 alle 09 27 15](https://user-images.githubusercontent.com/49115855/63750858-899ad080-c8ae-11e9-98a6-fe935501893b.png) "Alias" is not translated anymore. Just the "not sortable" fields, sortable fields work fine.
jcodewalker commented 2019-08-27 08:02:21 +00:00 (Migrated from github.com)

By the way, is there also a way to add CSS to the column headers, like align-right, without custom code?

By the way, is there also a way to add CSS to the column headers, like align-right, without custom code?

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.

> 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.
jcodewalker commented 2019-08-28 12:37:04 +00:00 (Migrated from github.com)

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!

Il giorno 28/ago/2019, alle ore 13:50, {{ǝʍǝ}}yn notifications@github.com ha scritto:

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.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/vdm-io/Joomla-Component-Builder/issues/468?email_source=notifications&email_token=ALWXFT7HNMNEDGKX44EEHHTQGZQ77A5CNFSM4IPFUCFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5K3BQQ#issuecomment-525709506, or mute the thread https://github.com/notifications/unsubscribe-auth/ALWXFT2AZFBJFEW5XLNQKR3QGZQ77ANCNFSM4IPFUCFA.

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! > Il giorno 28/ago/2019, alle ore 13:50, {{ǝʍǝ}}yn <notifications@github.com> ha scritto: > > 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. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/vdm-io/Joomla-Component-Builder/issues/468?email_source=notifications&email_token=ALWXFT7HNMNEDGKX44EEHHTQGZQ77A5CNFSM4IPFUCFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5K3BQQ#issuecomment-525709506>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ALWXFT2AZFBJFEW5XLNQKR3QGZQ77ANCNFSM4IPFUCFA>. >
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#468
No description provided.