META TITLE & DESCRIPTION in tablename_view.php

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
laurent
Posts: 2
Joined: 2020-12-05 14:28

META TITLE & DESCRIPTION in tablename_view.php

Post by laurent » 2022-09-12 15:03

Everything is in the title. For different reasons, I would like the META Title & Description to take the content of 2 fields that appear on pages like tablename_view.php?SelectedID

I haven't found any information on the forum, has anyone done this before, or has any advice to offer?

Thanks in advance

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 1527
Joined: 2018-04-01 10:12

Re: META TITLE & DESCRIPTION in tablename_view.php

Post by pböttcher » 2022-09-12 20:17

Hi,

sorry, but I do not understand what you try to acheive. Can you maybe make a screenshot and highlight what you would expect.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

laurent
Posts: 2
Joined: 2020-12-05 14:28

Re: META TITLE & DESCRIPTION in tablename_view.php

Post by laurent » 2022-09-13 07:21

Hello !
Ok for an example with the Appgini demo

Look at the source code of this page : https://demos.appgini.com/northwind/products_view.php

Code: Select all

<meta name="description" content="">
<title>Northwind | Products</title>
Now look at the detail of a product:
https://demos.appgini.com/northwind/pro ... ectedID=40

=> Same Title & same description

Is it possible to have a different title and description on this page?
For example, a META title that includes the name of the product and the description that would copy another field present on this page...

I hope I am clear

Thanks

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 1527
Joined: 2018-04-01 10:12

Re: META TITLE & DESCRIPTION in tablename_view.php

Post by pböttcher » 2022-09-27 19:28

Hi,

you can try to add to the hooks/TABELNAME-dv.js some code like:

Code: Select all


$j(function()) {
        document.title = 'YOUR NEW TEXT' ;
}
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply