I want to get the type of the page i.e PLP or PDP page
Get Type of Page(PLP or PDP) in SFCC
727 Views Asked by Nikhil Patil At
1
There are 1 best solutions below
Related Questions in SALESFORCE
- UI Component(Table Rows) Taking Too Much too in LWC
- Twilio Salesforce integration (Chat Transcripts)
- How can I automatically apply dark and light themes using the Lightning Email Template Builder in Salesforce based on the user's system preferences?
- Sending Slack Message to channel from salesforce flow
- How to redirect to parent object after child record creation
- Creating File in Drag and Drop Enabled File Cabinet in Netsuite using Rest API from Salesforce
- tsql functions like REPLACE() failing in azure data factory pipeline connected to salesforce
- An unexpected error occurred. Please include this ErrorId if you contact support: 1878486530-323938 (1541428280)
- My requirement is that I have to create DLRS for 'the date when the most recent email was received'
- Declarative Rollup Summaries Deployment
- Trouble updating a Field in Salesforce via a Python Script
- Why custom favicon for Salesforce-powered website not showing consistently in Google search results
- Salesforce chatter photo upload trigger
- Disable Azure DevOps Pull Request being completed when Using Copado
- AppFlow s3 to Salesforce upsert fails
Related Questions in SEO
- How to convert the size of the HTML document from 68 Kb to the average of 33 Kb?
- Should Organization schema be on every page?
- Can Angular minify, compress and remove unused JS and CSS files on build?
- What is the best strategy to correct a referenced subdomain development website damaging my production seo
- Optimizing Google Search Results: Enhancing Visibility and Content Presentation
- Build Landingpages on other domains to not hurt SEO of main business domain?
- Why is the url property invalid in schema?
- Why does Google use the icon from the manifest file instead of the favicon in the search results?
- Google Site Name showing url instead of structured data
- Defer in script tag not work as script evaluates before HTML is parsed
- Meta robots noindex follow
- Svelte SEO - Dynamic page title
- How to set specific width and height of a div element when media queries are present in css file?
- I want some of the content in my page to be crawlable but should not be indexed
- Can only use @graph keyword for schemas of same type?
Related Questions in DEMANDWARE
- OCAPI: exclude selected columns
- How to update an Image custom attribute in Demandware (i.e. Salesforce Commerce Cloud)?
- How to get information on whether a content asset is online or not in isml file?
- realm doesn't exist on the current cluster" B2C Commerce Developer Sandbox
- Why sfcc use isml instead of html?
- Get Type of Page(PLP or PDP) in SFCC
- Error configuring pipeline debugger in Eclipse
- Demandware (Salesforce Commerce Cloud) Controller Authentication
- How to replace Pipelet for ExportCustomerGroups in SFCC? (For removing Deprecated API usage)
- How to remove a product from a category API wise in Demandware(sfcc)?
- Not able to go to the function definition with SFRA code in vs code
- Custom event is triggered in Jquery but can't find any event handler
- What base URL should be used with SFCC endpoints for sandbox instances?
- Not able to save the user selected picklist value in SFCC Demandware
- Create session redirect link in content asset
Related Questions in SALESFORCE-COMMERCE-CLOUD
- User object Expressions not working in B2B Commerce LWR site
- REST API to fetch data from Wordpress
- Why Salesforce Ocapi customer deleted not working?
- Eslint Parsing problem in sfra salesforce project
- OCAPI: exclude selected columns
- the record id keeps being undefined?
- Unexpected token ? error while deploying Cartridge changes of SFCC using GIT
- Is there a way to identify unused script files in SFCC?
- SFCC OCAPI ProductSearch API - Returning ALL Products
- Not sure how to connect an AJAX call to a controller and make it update a object
- how to write an ajax call to a controller
- How to track button click in salesforce using javascript
- Salesforce B2B Commerce (LWR) - "global.css" style
- What is an example of an ajax function that can grab data based off a state change?
- Sticky element isn't fully viewable on mobile when scrolling down
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can determine the "type" of the page in a couple different ways within SFCC's controllers or backend logic (Server-exectued JavaScript) as well as some other ways when trying to detect this condition in frontend logic. (Browser-executed JavaScript) Additionally, for the frontend and backend solutions it may be different depending on the implementation that you're working on. Depending on it's age, and who implemented it, you may be working in a SiteGenesis, MFRA, or SFRA context. Possibly, even a 100% custom implementation. Therefore please accept this as a very general answer given that the question currently has absolutely no context whatsoever.
Backend Context
In all backend contexts, the solution relies upon the "ClickPath" data store of a session. You must be conscious that this may not be 100% accurate as there could be race conditions wherein users browsing in multiple tabs may have pages visited after the current request is processed and it is unknown whether the
lastentry in theClickStreamcould be 'newer' than the request being processed currently.Why the
pipelineNameattribute isn't present on theRequestclass is a bit confusing to me. Why wouldn't it be? Regardless, we must do what we must do.SFRA
All other contexts (Site Genesis & MFRA)
Frontend Context
The frontend context which represents JavaScript running in the browser relies upon variables that have been set by the server within the browser's execution context. Specifically, variables that are accessible within the context of the
app.jsmonolithic module in the case of SiteGenesis or SFRA 'client' modulesSFRA
In SFRA, there's a kind of 'global' JS module which is what you find in
main.jsand then there are type-specific JS modules likeproductDetail.jsandsearch.js. In the context of SFRA I'd recommend add your modules/scripts to one of those page-type-specific modules in order to execute different logic based on the page type.Site Genesis
Within the context of JavaScript executing on the page the following expression will typically give sufficient values to adjust behavior based on page type. Note, you may need to have this expression execute in the context of the closure within
app.jsin order for it to work.