-
Notifications
You must be signed in to change notification settings - Fork 79
CIF-1045 - [Research] Edit custom PDP / PLP page #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Disable CIF specific page filter on author instance - Make sure all the product links are properly set on author or publish instances - Adapted all components and unit tests
- Disable deep links (= hide specific page) on publish instance
- fixed merge issue and unit test
Codecov Report
@@ Coverage Diff @@
## master #179 +/- ##
============================================
+ Coverage 58.03% 58.04% +<.01%
- Complexity 481 482 +1
============================================
Files 148 148
Lines 4204 4205 +1
Branches 723 724 +1
============================================
+ Hits 2440 2441 +1
Misses 1670 1670
Partials 94 94
Continue to review full report at Codecov.
|
- use Sling HTTP request in SiteNavigation to build product and category URLs
- fix minor code formatting issue
| * @param variantSku An optional sku of the variant that will be "selected" on the product page, can be null. | ||
| * @return The product page URL. | ||
| */ | ||
| public String toProductUrl(Page page, String slug, String variantSku) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If SiteNavigation has the request object then all the methods asking for the Page should be refactored to just use the request path from the request object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be too easy, links are not created for and to the current page ;-) For example, on the category page you create links to product pages.
| import com.day.cq.wcm.api.PageManager; | ||
| import com.day.cq.wcm.api.WCMMode; | ||
|
|
||
| public class SiteNavigation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% related to this research but I think we should have this URL generation an OSGI service. So customers can bring their own implementation to generate PDP / PLP URLs based on their needs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's a good idea, customers will surely want to customise that.
Description
This PR is a possible solution to fix the editing issue of "specific pages": the idea as detailed by @mhaack in CIF-1045 is to disable the
SpecificPageFilteron author (actually except whenWCMMode.DISABLEDis set) and also have product and category URLs point to the specific pages. This way, on author one will see and be able to edit specific pages and links, while on publish all these "deep links and specific pages" will be hidden.How Has This Been Tested?
Extended unit tests and manually verified everything on publish.
Screenshots (if appropriate):
Types of changes
Checklist: