Developer forum

Forum » Swift » Swift 2 - Existing solution

Swift 2 - Existing solution

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

Will there be an guide for installing Swift 2 on an existing solution (I could not find one)?

Regards / Aki


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Aki

Not yet.

Below are the steps:

  • Copy Swift v2 item types to /Files/System/Items/
    • Go to items and refresh the meta data
  • Copy Swift v2 templates to /Files/Templates/Designs/Swift-v2/
  • Copy Swift v2 styles to /Files/System/Styles/
  • Create a new website (You cannot copy a Swift 1 website)
    • On website settings, layout tab, setup website layout - styles and default page template
    • Select /Files/Templates/Designs/Swift-v2/Swift-v2_Page.cshtm as the default page template
  • Start creating pages (This requires that you setup Swift v2 pages)
    • Create the "Swift Setup" section with the required pages
    • Setup the pages in navigation - Home, Shop, Product list and product detail pages

Swift setup section

Votes for this answer: 1
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Excellent. Thanks!

/ Aki 

 
Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

This feels like a stupid question, but I can't figure it out.

You say "Create the "Swift Setup" section with the required pages"

But how do I create a "Section" ? I can only create pages and folders underneath the "Navigation" section it seems.

Justin

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply
This post has been marked as an answer

Hi Justin,

It's actually not that stupid. I have scratched my head for a few hours trying to figure it out.

Apparently, you have a new attribute "Tree section" on the PageProperty:

Once you fill that out the first time, you also get the benefit of setting up permissions for Items:


I am not sure what happens if you set up a tree section, set up permissions for an item, then decide to rename or delete that section :)

Adrian

 

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

It is my turn to admit I may ask stupid questions.

I have started a clean setup on a clean DW10.16.5 solution with Swift v2. I have followed the list of actions described by Nicolai but I cannot manage to list products.
I have looked at the templates and I have found a bunch of:

Dynamicweb.Context.Current?.Items.Contains("ProductList")
Dynamicweb.Context.Current.Items.Contains("ProductDetails")
@RenderGrid(Dynamicweb.Content.Services.Pages.GetPagesByParentID(Pageview.ID).FirstOrDefault(p=>p.ItemType == "swift-v2_productlist")?.ID ?? shopPage)

In various templates. Can somebody explain the logic behind this approach? Who's setting that context?

I have, for example, a simple component configured exactly as in Swift v2 demo site. In the demo site it displays a mock price, in my project it displays:  "No products available".

I see that the only Product catalog APP is in the Shop page, the ProductList and ProductDetail pages don't have any additional ProductCatalogApps. I am guessing that is the page setting up the context, but it is clear that I am missing something in this whole setup process, and I need to understand it before I start configuring websites based on Swift V2.

Thank you,
Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys, me again :)

I have identified the potential root cause. My project was supposed to be accessible only for authenticated users. Once I have set permissions to disallow access to Anonymous users, nothing shows up in the Visual Editor. Of course, I should have probably set the Backend Users to have access to the pages but since Backend users already had access to the pages (I could edit the pages, including content and settings), I could not figure out that probably the Anonymous permissions would affect the aforementioned Dynamicweb.Context.Current.
I cannot say if this is a bug or intended, but it's confusing.

Thank you,
Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

I have tried setting "All" permissions for Backend users combined with "None" for Anonymous but the content is not displayed.

At this moment, I am not sure how I can set up a protection at website level and still manage Visual editor editability.

Thank you,
Adrian

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Also, if I select "Hide for anonymous users" option on the websites/Ecommerce, the entire rendering of the dummy data for product detail is not visible.
 

Adrian

 

You must be logged in to post in the forum