I like to have example text while editing my site, but this is causing UX issues on the site because the sample text is shown for a second while it’s being replaced.
Here’s my current code. <h6 dmx-text="userDetails.data.getUserDetails[0].first_name">Samantha</h6>
Here’s an example showing the flicker as I navigate from the home page to the project page. Notice the name in the upper right.
An alternative, if you have not already done so, is to use the Preloader component. This will give your data time to load by showing a spinner during the loading cycle.
Looks like that is added only if I use the formatter to add the Default. Copying and pasting the code does not trigger the formatter.js to be added.
Not sure if this is relevant, but I’m trying to do this in an include. It does look like it adds a reference, but my concern is that I use this include on all pages, not just the “Index” page.
<!-- Wappler include head-page="index.php" appconnect="local" is="dmx-app" bootstrap4="cdn" fontawesome_4="local" jquery_33="cdn" components="{"dmxFormatter":{}}"-->
@teodor, I now have it working on my Index page, but I’m trying to use includes and there seems to be a gap in logic. Maybe we should make this into a separate post/ticket?
I want to use the _header.php include on ALL of my pages.
The problem I’m noticing is that the include has a reference at the top to one page – which makes the include very ineffective for use across multiple pages.
I ripped out more of the code on the index page and put it in the _header.php include. I also removed the “Wappler Include” line at the top of the include. This appears to be working, outside of a syntax error showing in the editor because I did not move the <head> tag into the _header.php include, only a certain set of lines before the </head> tag.
It would be really nice if I could pull everything in the below code into the _header.php file, but I would need a way to make the “content” values in the meta tags dynamic. Possibly reading from a db table that’s unique for each page.