Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andy Boston 28 posts 47 karma points
    Jan 23, 2015 @ 16:51
    Andy Boston
    0

    Landing Page structure

    Hi,

    I'm a complete newbie with Umbraco so hopefully one of you can help me

    I've set up a structure to have landing pages seperate from the main site for promotions etc

    home
    -- page
    -- page
    landing pages
    -- landing page 1
    -- landing page 2

    When I go to view landing page 1 or 2 it returns an error.

    Is there something I have to do on the server to make the landing pages folder work?

     

    many thanks

    Andy :)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 23, 2015 @ 17:04
    Jan Skovgaard
    0

    Hi Andy and welcome to our :)

    Could you provide the error message you're getting please? That makes it easier to figure out where things go wrong. However I have an idea about what it could be though...

    But before going into specifics I would like to know if the landing pages should be a part of the same domain as your "Home" structure? Should it share the same styling etc. or should it have some custom styling?

    /Jan

  • Andy Boston 28 posts 47 karma points
    Jan 23, 2015 @ 17:09
    Andy Boston
    0

    Hi, thanks for the reply, here's the error

    Server Error in '/' Application.

    Runtime Error

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    Details: To enable the details of this specific error message to be viewable on remote machines, please create a

    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's


    Ideally, I'd like it to run under the same domain name and share css and js files but not be included under the main website under Home

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 23, 2015 @ 17:15
    Jan Skovgaard
    0

    Hi Andy

    Ok, in order to be able to see the real error message you need to edit your web.config file and set the otherwise you don't get the real error message. When developing it's ok to have this switched off but on a live site it's a good idea to have it enabled.

    Once this is done you should see another error message and please post that in here :)

    Well, you will need to have the "Landing page" section as a child under the "Home" node if you're going to run it on the same domain. If the section are on the same level in the backoffice then the landing page section need to have it's own domain setup.

    /Jan

  • Andy Boston 28 posts 47 karma points
    Jan 23, 2015 @ 17:21
    Andy Boston
    0

    Ok, thanks I'll have to ask my hosts to do that.

    It seems easier to put them under the "Home" node but is there a way to hide them from the main navigation?

     

    i have this code in a top menu partial view

    <ul class="nav navbar-nav">

               @foreach (var page in root.Children.Where("Visible"))

               {

                 <li class="@(page.IsAncestorOrSelf(CurrentPage) ? "active" : null)">

                   <a href="@page.Url">@page.Name</a>

                 </li>

               }

             </ul>

    I take it Ihave to add something to this to stop a node called "Landing" and it's sub nodes from showing up??

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 23, 2015 @ 17:29
    Jan Skovgaard
    0

    Hi Andy

    Yes, you need to add a property of the "true/false" type with an alias of "umbracoNaviHide" on your document types and then in your "Content" section you can put a checkbox on those items that should not be visible when rendering the content and checking for "Visible" as you're doing above.

    It's an Umbraco defacto standard so you should add it to each node you don't want to be a part of a navigation rendering for instance.

    But regarding the Lading pages a better approach would probably be to exclude the document type alias, which I assume is different from the main website?

    In that case you could write something like this assuming the document type alias is "Landing"

    @foreach (var page in root.Children.Where("Visible && NodeTypeAlias !='Landing'"))
    

    Does this make sense? You can see an example of the code here http://markdevelopmentblog.blogspot.dk/2014/07/umbraco-razor-list-random-pages-from.html

    /Jan

  • Andy Boston 28 posts 47 karma points
    Jan 23, 2015 @ 17:38
    Andy Boston
    0

    Jan, you're a star :)

    I'll give those solutions a go!

    Many thanks for your help!

    /Andy

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 23, 2015 @ 18:48
    Jan Skovgaard
    0

    Hi Andy

    Happy to help - Please give a shout in here if you have more questions. Lot's of friendly people who loves to help each other out in here :)

    Happy coding.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft