Add two Boolean properties to a PageTemplate

Igor Pysanka asked on August 18, 2015 13:30

Hello everyone. I need to add two Boolean properties to the PageTemplate. Also I need to change it in admin panel and read in the source code for concrete content page. How can I do this?

Thanks in advance

Recent Answers


David te Kloese answered on August 18, 2015 15:05

Hi,

Why would you want to have extra properties on a Page Template these settings are only used in development? Don't you mean on a page type so a content editor can set them? They are designed for this and will automatically be adjustable via the forms tab! https://docs.kentico.com/display/K81/Creating+page+types

You can get this data via use of webparts / widgets and user controls... What should these booleans do?

David

0 votesVote for this answer Mark as a Correct answer

Igor Pysanka answered on August 18, 2015 15:07 (last edited on August 18, 2015 15:08)

I try to do it on Kentico 7

I need to add 2 webcontrols to PageTemplate and on a Content page which is based on this PageTemplate I need to show or hide these web controls.

I don't know how to do this

0 votesVote for this answer Mark as a Correct answer

Adam Gitin answered on August 18, 2015 16:29

Just to clarify, is this what you want to do:

Page template: -has web parts. - used on multiple pages.

You would like to control visibility for these webpart on a per page option?

If this is true, you can add fields to page type (bool, checkbox) to control each webpart visibility.

Then using a macro you can get that value into a webpart visibility. i hope this helps.

3 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.