+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / custom page attributes

custom page attributes

9 posts, 1 answered
  1. Paulo
    Paulo avatar
    21 posts
    Registered:
    06 Dec 2010
    07 Jan 2011
    Link to this post
    Hi,

    I am developing a custom navigation control that alows us to manage the menu as we need, but now I have to show a footer menu, and there i have to show some of the hidden pages,  at the moment I have to put on the Keywords a specific keyword to do the trick, but I think it would be usefull to have a custom proprieties param at the page Title & properties, this could be acomplished by a table that saves a kind of dictionary(Key, Value).

    If it is already something on Sitfinity to do it, I would be glad to know how.

    thanks in advance.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Jan 2011
    Link to this post
    Hi Paulo,

    You can create the a custom fileds form PageData programmatically

    App.WorkWith().DynamicData().Type(typeof(PageData)).Field().TryCreateNew("MyPageDataField", typeof(string)).SaveChanges(true);
    var dynamicContent = App.WorkWith().DynamicData().Fields().Where(dc => dc.FieldName == "MyPageDataField").Get();
    var pg = App.WorkWith().Pages().Where(pk => pk.Name == "somename").Get().SingleOrDefault() as PageNode;
    pg.Page.SetValue("MyPageDataField", "somevalue");


    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Paulo
    Paulo avatar
    21 posts
    Registered:
    06 Dec 2010
    07 Jan 2011
    Link to this post
    Hi,

    Thanks for the quick answer, but I cannot do it dinamically unless I know the pages to associate the new attribute.
    The problem is:

    step 1: user add a New Page to his sitefinity site
    step 2: user set the title, description and that the page will not dislay in navigation
    step 3 : user "Needs" to say that his new page must appear in footer.

    The Step 3 is what I need, and perhap's you guys could add a field\grid in title & proprieties of the page where the user could specify some  custom parameters...  "And on saving you could associate it to the page created".

    Thanks.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Jan 2011
    Link to this post
    Hello Paulo,

    We will have UI for custom fields after the official release - Q1-Q2 2011. This will allow you to add custom data from the UI as you can do this for the other content items.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
    Answered
  5. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    16 Feb 2011
    Link to this post
    Hi Ivan,

    I have programmatically added the custom field for the pages. Now how can i add the ShowInFooter checkbox to the page properties UI and how do I store the value ? 

    I was able to extract the templates from Sitefinity.Resources:

    Telerik.Sitefinity.Resources.Templates.Backend.Pages.CreatePagePropertiesView.ascx
    Telerik.Sitefinity.Resources.Templates.Backend.Pages.EditPagePropertiesView.ascx

    I also noticed that the class for the view is PagePropertiesView with 2 constants CreateDialogTemplateName and EditDialogTemplateName. What i am thinking is to override the PagePropertiesView class but I need to change the templates from embedded to the external templates and I need to tell sitefinity to use my CustomPagePropertiesView instead of PagePropertiesView.

    I hope i am going in the right direction.

    Best,

    G
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    22 Feb 2011
    Link to this post
    Hello George ,

    You could try to inject custom controls in the page definition Telerik.Sitefinity.Modules.Pages.PagesDefinitions. Since there is no out of the box you need to replace the definition. You might find this post useful

    Regards,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  7. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    06 Sep 2011
    Link to this post
    Hi Ivan,

    It would be great if this would be supported in the UI?
    Just like on a contentitem it would be nice to have taxonomies on a page.

    Maybe an item in PITS so that we can vote for this?

    Regards,
    Daniel
  8. Antoaneta
    Antoaneta avatar
    258 posts
    Registered:
    02 Nov 2015
    09 Sep 2011
    Link to this post
    Hello Daniel,

    Thank you for getting back to us.  Your request is added in our PITS system where you can vote for it. Please use the following link:  http://www.telerik.com/support/pits.aspx#/public/sitefinity/7789


    Regards,
    Antoaneta
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  9. Trevor
    Trevor avatar
    35 posts
    Registered:
    28 Jan 2012
    13 Mar 2012
    Link to this post
    this makes me sad... y u no put custom fields on pages :(
9 posts, 1 answered