Close

display 2 columns on all pages

bsgcraft
8 years ago
#10773 Quote
Avatar
  • 49
I am trying to figure out where to add the _ColumnsTwo reference so that all pages have 2 columns rather than one. Our home page is also unique so we have created a view for that (_ColumnsTwoHome). Thank you.
Nate Kindom
Aleks
8 years ago
#10776 Quote
Avatar
  • Moderator
  • 70
jkeeler wrote:
I am trying to figure out where to add the _ColumnsTwo reference so that all pages have 2 columns rather than one. Our home page is also unique so we have created a view for that (_ColumnsTwoHome). Thank you.


Hi,

for each page you want to be two column, you need to add at the top of the view, this code:

@{
   Layout = "~/Views/Shared/_ColumnsTwo.cshtml";
}

Hope this helps!
Regards,
Aleksandar Ivanov
Nop-Templates.com
bsgcraft
8 years ago
#11780 Quote
Avatar
  • 49
Ok. I see that in the Home view there is an index.chtml file for the home page. What view is being used to display topic pages? That is where I will need to add this then.
Nate Kindom
bsgcraft
8 years ago
#11781 Quote
Avatar
  • 49
Ok So I found in the default install there is a Topic folder with the file TopicDetails.chtml. I modified this and it looks like I have the sidebar now on the topic pages.  
Nate Kindom
bsgcraft
8 years ago
#11782 Quote
Avatar
  • 49
For any others that are trying to solve this, copy the Topic folder in Nop.Web/Views/ and move it to your themes views directory. Then modify the file. I do not recommend modifying the core views.
Nate Kindom
Aleks
8 years ago
#11783 Quote
Avatar
  • Moderator
  • 70
jkeeler wrote:
Ok. I see that in the Home view there is an index.chtml file for the home page. What view is being used to display topic pages? That is where I will need to add this then.


Topic pages uses the Topic/TopicDetails.cshtml. At the top of the view you would probably see:

    if (isPopup == null || isPopup == false)
    {
        Layout = "~/Views/Shared/_ColumnsOne.cshtml";
    }
    else
    {
        /*pop-up windows*/
        Layout = "~/Views/Shared/_RootPopup.cshtml";
    }

Replace the bold text with _ColumnsTwo.cshtml
Regards,
Aleksandar Ivanov
Nop-Templates.com