Sitecore personalisation - previous page - sitecore

The website has these pages - Home, Product1, Product2 and the Home page has a banner.
When user's journey is - Home > Product1 > Home, the banner should show image1.
When user's journey is - Home > Product2 > Home, the banner should show image2.
When user visits - Home > Product2 > Product1 > Home, the banner should show image1.
..which means, I want to show the image based on the last visited page before Home.
In the rule set editor, I set the 3 rules:
1. where the specific page during the visit is "product1" , then the image will be image1.
2. where the specific page during the visit is "product2" , then the image will be image2.
3. Default - hide banner
This is not working as desired. If user visits product1 first, then its always image1 in the banner. I understand it's working according the rule, as rule 1 will always become true here.
But, how can I achieve what I need.

You'll have to create a custom condition for that. There are lots of blogposts around how to do that part, so I won't focus on that.
Your condition could be something like where previous page is specific page
Then in your condition, you'll pass in an ID (where it says specific page). You can then do something like this in the condition:
var pagesVisited = Sitecore.Analytics.Tracker.Current.Interaction.GetPages().ToList();
return pagesVisited.Last().Item.Id == Guid.Parse(id); // id is the item you've selected in the Rule Editor
(Note that I haven't tested the code, but it should be similar to this. You might also want to run a bit of a performance test on it of course).

Related

Adding a multiple Image gallery to a page with text?

I'm learning Wagtail and I'm trying to make a basic Ecommerce style site. The layout will be:
Home Page
-> Products
-> Product 1
-> ...
-> Product N
-> About
-> Contact
In the Product page I want to have a Title, Description, Picture gallery or just display a few pictures and eventually tags (But this post is about the Images). I have checked this Documentation which explain how to add Abstract Images in the View but it leaves me confused on what to import and add to the model, what type? when I just want to add 1,2...n Images on a Product page. The documentation only explains how to add an Image into a form and it leaves me wondering should I use a Django type or Wagtail type?
How would I add the ability to upload/remove images from the admin console Product page?

How to change product url by id to name in opencart?

the defult url of a product is =
http://localhost/OpenCartDesign/upload/index.php?route=product/product&product_id=64
I want to change this in http://localhost/OpenCartDesign/upload/index.php?route=product/product&product_name= here show product name not product id
Rename /OpenCartDesign/upload/.htaccess.txt to /OpenCartDesign/upload/.htaccess. Inside Dashboard go to System > Settings > Action: Edit (Store) > Server (tab) > Use SEO URLs: YES and click the SAVE button.
Then you will have this http://localhost/OpenCartDesign/upload/product-name which is much better for SEO.

How to setup a Django CMS 3 menu sitetree?

I want to have multiple site trees and, dependent of the role, display the corresponding menu.
For instance; this is my menu:
Site
Home
Products
Contact
User
Start
Admin
Now i can display my menu for a User like this:
{% show_menu_below_id "User" 0 1 0 1 %}
That will look like this: Start | Admin
The problem is that i want to have it start on "User/Start" and not on "User".
The url: /user/ should actualy by /user/start/
"User" should act like a tree node and i just need it to have an id to display the right tree, but that is about is, i do need it to start at... "Start".
I find it hard to find all ins en outs of Django CMS3 and i am sure/hope this is possible, but can not figure out how? I am not even sure where to look.
I found: add CMS_REDIRECTS = True to the settings.
then you can hardcode a url in the extra fields in the CMS.
Would be nice if it was not hardcoded, but i can continue now.

Create post-forms such as craigslist on my Django powered website

I'm creating a marketplace website such as Craigslist. I'd like to make "post-forms" for users to post their own product information (by uploading photos, adding forms (name, price,condition,,etc.)) on my website' category-page.
Now, I think I can do these things by making use of "Django Permission", but is it correct? If so, how can I do that? Or if not, there are other ways to allow users to do these things ?
The short summary of my website is like below. Specifically,I'd like to know how to allow people to post their products on the category page.
Register & Login
You would have several categories such as furniture, books, games,,, and then, click one of those categories. (I've created this category-page by using "Django admin")
(eg. )
http://bakersfield.craigslist.org/
Then, you can see what kinds of goods are sold on that category page. And then, At the top of website, you can find "Post" button to post our products on the top of my website.
And after click it , you can find "Posting title" "Price" and "upload photos" and many other forms.
(eg)
https://post.craigslist.org/k/7v...
4.After filled those forms,then click "submit" button to post your products pages' link to category page.
Craigslist is the best example for my website.

Facebook Like button - comment box with breif description and image

On my website when the user selects the facebook like button they have the option to enter comments. This popup window to enter comments only contains the users avatar and place to enter comments. How can i include my pic and a brief description of the site directly below the comment???
At first I thought it was from the HTML title attribute or meta property="og:title" ... but populating these have no affect
I have another site that contains both pic and a desc below the comment but the pic seems to be grabed at random -but always the same- from the site and the short desc I thought from the -title- attribute but its not - I changed the -title- and it still shows the same desc, its like its cached???
Any ideas how to control or populate a brief description and image within the comment section of a like button???