Question

Photo of Richard Sanford

0

New site with Page Attributes

I've got a problem and not sure what's going on in order to use Page Attributes for a new site I created...I've set up some Page Attribute Values for my site and uploaded an image and some header text to test but nothing displays on the test page. Is there something else I need to look for to make sure the attributes can display on a page? thanks

  • Photo of Eddie Holeman

    0

    Richard, I am no expert at this, but we use Page Attributes of some of our sites. If you go to https://upstatecollective.org/aboutucc, you will note the image of the city of Greenville near the top of the page. This comes from a page attribute. The layout for this page is attached here in a zip file: FullWidth.zip Hoping this provides something to think about.

  • Photo of Michael Garrison

    0

    Richard, did you make any headway with this? Just adding an attribute to a site alone doesn't do anything except make the values available to you...your theme will need to know to go and get the values and display them correctly.

    What theme are you attempting to use for the site you added these attributes to?

  • Photo of Michael Garrison

    0

    The Stark theme doesn't have anything built into it to use page attributes. Adding a page attribute makes it available, but something has to go and use it.

    One option is to download the Agency theme from the Rock Shop. It (and perhaps other themes) is designed to use certain page attributes like you're saying, and is designed to display them on the page when a value is provided.

    Another option that is probably not the most common nor the best but might be a good introduction to how it works, would be to get and display the value in a block. This wouldn't require you to know how to modify themes. To test this out, add an HTML block to your page (or even set it to display in this location on every page in your site).

    If your page attribute has a key of 'HeroImage', for instance, you could add something like this to your HTML block:

    {[ parallax image:'/GetImage.ashx?Guid={{ CurrentPage | Attribute:'HeroImage','RawValue' }}&maxwidth=2000' contentpadding:'20px' ]}
        <h1>{{ 'Global' | Page:'Title' }}</h1>
    {[ endparallax ]}

    That's going to use the parallax shortcode to display your page's title on top of your hero image, and when you scroll, the image will scroll more quickly than the rest of the page. Now, you don't have to use the shortcode, but it's an example of how your blocks or your theme will be responsible for displaying the image you provide in your attribute on the page however you want it to.

    It's just a sample- you'd want to do something much cooler with it I'm sure, but this might help get you started with using these attributes in your site.

    HeroImage-PageTitle-Parallax.png

    By the way, once you do want to get into building a custom theme, make sure you're not using the default "external site" pages (they're just designed as a sample and may be changed automatically in future updates). It would also be best to copy the "Stark" theme and make a new theme instead for your new site so you can make changes without worrying that an update would overwrite anything you've done.

    • Richard Sanford

      Thanks so much Michael I had forgotten about the short code and adding it to the block to use the attribute...also thanks about the Stark theme and the update process...