Fetch the current page name in LWC - salesforce

I created some pages with a hierarchy like Home(with child pages), About US, Contact How can I fetch the current page in lwc template?
Are there ways to fetch all the available pages in the community using the same template? Or is there any API object for the page name I can pass?
Thanks

Related

route to statically generated page based on url with NextJS

I'm building an app where different users can register and get a frontpage. I then assign each user a subdomain (say userA.mydomain.com) and would like to display the user's frontpage when we access his subdomain.
I already got it working that the different subdomains route to the NextJS app, but now I need to display the user's data on that frontpage. So when we go to userA.mydomain.com I need to display userA's data.
I know that I can generate the static pages for each user by creating a page under /pages/frontpages/[userId].tsx, but then the domain would look like this: userA.mydomain.com/frontpages/userA. This is redundant, because we already know the userId because of the subdomain. Also we can access other user's frontpages from another user's subdomain.
I also know that I can fetch the data inside the index page, but then we loose all benefits of statically generated pages.
My questions are:
Is there a way to get what we would have with pages/[userId].tsx but for the index page? I don't want to fetch the data inside the index page itself because then I loose the benefit of statically generated pages. Maybe there's something that we can do with getStaticPaths?
For example is it possible to prerender the frontpages using getStaticPaths for pages/frontpages/[userId].tsx and then inside the index page we just render the content of the generated frontpage page (based on the subdomain of the url)?

Dynamic Routing using Next.js and React Js

I am creating a Ecommerece application in React/Next Js. I want create dynamic routing with different peramaters for both product detail page and category page.
for Example if I click on category then its routing will be
https://www.mywebsite.com/my-category-page-url
If i click on any product from that category then its routing will be
https://www.mywebsite.com/my-product-detail-page-url
Note: I have already a live website with daily 30K visitors and with different tech stack which follows same url structure so I can not change the url structure.

Retaining page number of datatable in angular.js after updating a record in angular js

I have a datatable in my code on a view page of transaction and to update a child entry from it I have to route to child page, When I edit and update the child and route to view page again . The page number is reset to one .Please tell me how to retain the selected page number
You could use a service to store such data that should "survive" navigation between pages.
Services are injected into the controllers and are signletons = the service object is created by angular only once and the same object lives as long as you do not leave the angular app or F5 refresh the app.
(I did not explain how to use a service, as you can find many examples and great documentation about it)

Piwik Analytics solution for extjs single page application

I have a Single Page web application which just has index.html as the entry page for application, all other URLs and screens load based on extjs scripts.
I added the Javascript tracker code before tag and am able to track whenever a user logs in via index.html page. Howerver, there are multiple screens with different URLs in my application, not sure how can we track other screens(different URLs loaded at runtime) via Piwik
I saw some solution for Angular JS single page application, do we have something similar for extjs as well?
Please post any related information and with those pointers, probably we can reach a solution.
Thanks in advance!
There is currently no official guide about this but it is planned.
In order to track the different screens, you will need to push manually page views to Piwik. First you can have a look at the guide for the JavaScript Tracking Client.
Here is an example to push a page view:
// Piwik must be loaded normally above
// Track a page change
_paq.push(['setCustomUrl', newUrl);
_paq.push(['setDocumentTitle', document.title]);
_paq.push(['trackPageView']);
You could also track events if some links are more "actions" than pages.
You can also have a look at all the features and options in the JavaScript Tracking Client API reference.

managing opengraph and meta properties with backbone (or any JS MVC framework)

I have a backbone app (a blog) displaying different articles we can share on many platforms.
I try to use open graph with google and facebook, i update the properties in the router just before rendering the view.
But the thing is, when the scraper reach the app, it doesn't get the meta properties, i don't know if it doesn't execute javascript or if it's too fast, but if i set up some default meta properties directly in my single page it works.
However i need to update the meta properties about the url (each article has their own meta properties).
So, is it possible to use open graph with backbone.js ?
I am struggling with the problem and it seems Facebook is not running javascript in their end. There is no way, but creating separate page in your server for stuff you want to share on Facebook and include all meta tags statically in those pages.
There are services that will render javascript generated page for SEO purposes. Check out https://prerender.io
An alternative is to have your server populate the <meta> tags before the page is served.

Resources