Replies: 3 comments
-
Hi, Under You can also check |
Beta Was this translation helpful? Give feedback.
-
Thank you so much, @dziudek! Both methods work correctly, but unfortunately, they don’t identify the site’s homepage, which could be generated by either When I set a page as the homepage, I get:
If I then set
Ecco la traduzione in inglese: I also tried using When distributing a plugin that modifies the frontpage, I can’t know the user’s settings. |
Beta Was this translation helpful? Give feedback.
-
Hi, Actually, I can determine the settings:
But to make changes only on the frontpage, the only way that comes to mind right now is by comparing the URLs: const homeUrl = rendererInstance.globalContext.website.baseUrl;
const pageUrl = rendererInstance.globalContext.website.pageUrl.replace(/\\/g,"/");
if (homeUrl === pageUrl) {
// homepage
} |
Beta Was this translation helpful? Give feedback.
-
I made a plugin that modifies some aspects of the home. The problem is to identify the home and I did this:
main.js
This method of string comparison works (the replace is for compatibility with windows systems), but it looks unprofessional.
Is there a better method?
Thanks a lot
Beta Was this translation helpful? Give feedback.
All reactions