Custom form view - ONLY during adding new item.

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
netica
Posts: 9
Joined: 2015-03-03 13:07

Custom form view - ONLY during adding new item.

Post by netica » 2022-04-08 16:19

Hi, I need to change website look ONLY during adding new item. Whant I need is:
1) hide header and footer
2) hide Back button
3) hide ID field
4) change or hide "table details" header
5) add custom background image
6) add some html before form

I'v add hook file (tablename.php) and ad some code to "function tablename_header" like this:
echo "<br/><br/><br/><br/>NEW HEADER";
echo "<body style='background-color:pink'>";

but don't know how to add some custom CSS to make all changes I need :(
CSS is my natural envinmet so it would be great to add some code like: diplay:none :):):)

Need some tip from pro.
Thank you in advance.

Regards Greg

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Custom form view - ONLY during adding new item.

Post by pbottcher » 2022-04-08 17:19

Hi,

1) hide header and footer <--- what do you need to hide, maybe a screenshot ist helpful
2) hide Back button <--- you can do this via css
3) hide ID field <--- you can do this in the AppGini definition for the field
4) change or hide "table details" header <--- you can do this via css
5) add custom background image <--- you can do this via css
6) add some html before form <--- what do you need to hide, maybe a screenshot ist helpful

In oder to add some css, you can use the function tablename_header -> case 'detailview' can put some code like:

Code: Select all

			case 'detailview':
				$header='<%%HEADER%%><style>#deselect { display:none;}</style>';
				break;
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.

netica
Posts: 9
Joined: 2015-03-03 13:07

Re: Custom form view - ONLY during adding new item.

Post by netica » 2022-04-13 15:13

Hi, thak you for quick reply. Points 1, 2, 4, 5 are clear, I'v made it via css. Point 3 also I'v made it standard AppGini feature.
But still have question to (6) - I'm trying do it by add code like that:

Code: Select all

	function tablename_header($contentType, $memberInfo, &$args) {
		$header='';
		echo "<br/><br/> I want to put here some text and logo! </p><br/><br/>";
But I don't it is the best way ;)
Now it looks like this -> https://i.imgur.com/OIwZbvH.png

Regards
Greg

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Custom form view - ONLY during adding new item.

Post by pbottcher » 2022-04-13 17:54

Hi,

glad all the points work. For Point 6, what do you need?
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.

netica
Posts: 9
Joined: 2015-03-03 13:07

Re: Custom form view - ONLY during adding new item.

Post by netica » 2022-04-14 06:41

Hi, all I need is to be shure about place where I should put my own HTML header.
On my last post I show you code - is it right place to put HTML?

#################################
And maybe some new question ;)
Is it possible to make all of my chcnges only for guest user?

My goal is to make reservation form for guest users + panel to check it by secretary.
What we where talking about here is this form (panel is a standard functinality in AppGini).
Each of my change take action for every user, I would be great if only guest could see my custom header and css but secretary should have standard AppGini view.... Possible?

Regards
Greg

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Custom form view - ONLY during adding new item.

Post by pbottcher » 2022-04-16 08:02

Hi,

there are several places where you can add your code. So it always depends a little bit on the usage.
But the hooks/TABLENNAME.php is a very good option.

For the new quation.
If you have your code in the TABLENAME.php you can use the $memberInfo information to check which user is currently accessing your page. So you can identify easily, with an if query, if it is the guest user and only add the code then.

Have a look at https://bigprof.com/appgini/help/advanc ... Info-array
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