Is it possible to not display content on a page?

Topics: Customizing Orchard
Nov 20, 2012 at 10:20 PM

I am trying to create a home page that has only TripelFirst, TripelSecond, and TripelThird to carry the page information. The steps I followed are

1) Define the layer for the homepage (with a rule of 'url("~/")' ) to show widgets in only those zones.

2) Removed the content widget from the default layer and created a new layer with that widget and a rule of 'not url("~/")' so that pages other than the homepage would have a content widget in the content zone.

I still get the name of the page and the date created in what appears to be the content zone. I tried modifying the rule in step 2 to be 'url("~/thispagedoesntexist")' so that it evaluated as false and the home page and other test pages still show content.

So I think I am missing something fundamental about the content zone, layers, and widgets.

This is Orchard 1.6 with the default ThemeMachine theme.

Nov 21, 2012 at 3:16 AM

Use shape alternates for Page Title part to control the rendering

Nov 21, 2012 at 12:15 PM
tippingpoint wrote:

Use shape alternates for Page Title part to control the rendering

That seems like a "long way around the barn" for something that should be handled with layers/widget placement out of simple configuration.

Nov 21, 2012 at 8:32 PM
Edited Nov 21, 2012 at 9:03 PM

Mark,

This is what I did--I am not sure if it is the 'proper' way but it works fine for me.

In Layout.cshtml, determine if you are in the Homepage(I have two, one english, one French). So, in razor I have:

 

 

    var homePage =         (Context.Request.AppRelativeCurrentExecutionFilePath == "~/") ||      

  					(Context.Request.AppRelativeCurrentExecutionFilePath == "~/fr") ? true : false;

 

 

Then, when you are defining the zones, only render the Content when it is not null and it is not in the homepage:

 

 

@if (Model.Content != null && !homePage)     

{
@Zone(Model.Content)
}

 

 

This was before I ever messed with Placement.info, so I never tried to do it that way. 

I am all ears if there are better ways to accomplish the same results.

 

Coordinator
Nov 22, 2012 at 8:08 PM
I'm sorry, I'm confused, I'm not sure what's being asked here, as I fail to see a question anywhere in the initial post. What are you trying to do?


On Tue, Nov 20, 2012 at 2:20 PM, MarkStega <notifications@codeplex.com> wrote:

From: MarkStega

I am trying to create a home page that has only TripelFirst, TripelSecond, and TripelThird to carry the page information. The steps I followed are

1) Define the layer for the homepage (with a rule of 'url("~/")' ) to show widgets in only those zones.

2) Removed the content widget from the default layer and created a new layer with that widget and a rule of 'not url("~/")' so that pages other than the homepage would have a content widget in the content zone.

I still get the name of the page and the date created in what appears to be the content zone. I tried modifying the rule in step 2 to be 'url("~/thispagedoesntexist")' so that it evaluated as false and the home page and other test pages still show content.

So I think I am missing something fundamental about the content zone, layers, and widgets.

This is Orchard 1.6 with the default ThemeMachine theme.

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Coordinator
Nov 22, 2012 at 8:10 PM
Are you trying to remove the date and title? If so, that's not a widget, it's parts. If in placement you match on the home page url and send the title part and common metadata to the "-" zone, that should do the trick.


On Thu, Nov 22, 2012 at 12:07 PM, Bertrand Le Roy <bertrandleroy@gmail.com> wrote:
I'm sorry, I'm confused, I'm not sure what's being asked here, as I fail to see a question anywhere in the initial post. What are you trying to do?



On Tue, Nov 20, 2012 at 2:20 PM, MarkStega <notifications@codeplex.com> wrote:

From: MarkStega

I am trying to create a home page that has only TripelFirst, TripelSecond, and TripelThird to carry the page information. The steps I followed are

1) Define the layer for the homepage (with a rule of 'url("~/")' ) to show widgets in only those zones.

2) Removed the content widget from the default layer and created a new layer with that widget and a rule of 'not url("~/")' so that pages other than the homepage would have a content widget in the content zone.

I still get the name of the page and the date created in what appears to be the content zone. I tried modifying the rule in step 2 to be 'url("~/thispagedoesntexist")' so that it evaluated as false and the home page and other test pages still show content.

So I think I am missing something fundamental about the content zone, layers, and widgets.

This is Orchard 1.6 with the default ThemeMachine theme.

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com



Nov 24, 2012 at 12:09 PM

Bertrand,

What I am trying to do is have a home page that shows content of widgets only in the TripelFirst/Second/Third regions. I thought I could do this via the Widget management by removing the Content widget from the Content zone in the Default layer. What I was trying to express was that this didn't work as the page title and date were still being rendered in the content zone.

You just added 'If in placement you match on the home page url and send the title part and common metadata to the "-" zone, that should do the trick.' I don't see in the documentation where placement is described nor the "-" zone nor how to send data to that zone.

I haven't tried it yet but the workaround with the conditional in the CSHTML file that Martinelli suggested above sounds like exactly what I want. I should be able to try that later today or over the weekend.

Mark

Optimium Health Inc

________________________________________

Mark Stega, M.D.

1795 Beachfield Road; Annapolis, MD; 21409-6042

phone: 443.994.0169

email: mark@optimiumhealth.com

Visit Us On The Internet: http://www.optimiumhealth.com/

Nov 26, 2012 at 6:57 PM

Martinelly,

Your CSHTML workaround does exactly what I was looking for.

Bertrand,

I realized my initial lack of understanding was that page content was not rendered by a widget but is, instead, handled at the rendering level when a page is to be displayed. I still haven't found the appropriate documentation for 'placement'.

Mark

Coordinator
Nov 26, 2012 at 7:04 PM
Really? http://docs.orchardproject.net/Documentation/Understanding-placement-info (first result if you search for "placement" on the documentation site) says:
"There is a special value, "-", that suppresses the shape rendering instead of sending it to a local zone."



On Sat, Nov 24, 2012 at 4:09 AM, MarkStega <notifications@codeplex.com> wrote:

From: MarkStega

Bertrand,

What I am trying to do is have a home page that shows content of widgets only in the TripelFirst/Second/Third regions. I thought I could do this via the Widget management by removing the Content widget from the Content zone in the Default layer. What I was trying to express was that this didn't work as the page title and date were still being rendered in the content zone.

You just added 'If in placement you match on the home page url and send the title part and common metadata to the "-" zone, that should do the trick.' I don't see in the documentation where placement is described nor the "-" zone nor how to send data to that zone.

I haven't tried it yet but the workaround with the conditional in the CSHTML file that Martinelli suggested above sounds like exactly what I want. I should be able to try that later today or over the weekend.

Mark

Optimium Health Inc

________________________________________

Mark Stega, M.D.

1795 Beachfield Road; Annapolis, MD; 21409-6042

phone: 443.994.0169

email: mark@optimiumhealth.com

Visit Us On The Internet: http://www.optimiumhealth.com/

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Nov 26, 2012 at 7:12 PM

Bertrand,

Thanks - Sometimes it is the simplest of things that cause me to trip, I had performed a search, I probably typo’d “placement”

Mark