Text Layout on Dynamic Pages (HTML?)

Hi I have setup some dynamic pages and all is connecting fine.
On 1 page however I need to do more with layout.
But it seems I can only put “plain text” in the Dataset. And that is treated as 1 big textblock.
The best is to explain with example on the old site with good layout: https://www.maatwerkarbeidsadvies.nl/portfolio-items/hr-advies-op-maat/

The best I could find now is to cut all texts in pieces, so in my Wix site this pae exist of 12 different textfields, connected to 12 different field in dataset.
Not very dynamic :wink:

Can anybody help me out pls?

You can put html text into a dataset field, just simply use a rich text field and set it up within the field itself.

Or use it like this page here.
https://support.wix.com/en/article/corvid-about-formatting-text-elements

Ahhh yes, that’s it. Didn’t see that one yet.Thanks, you’re a star!

Is there a way I can get a more elaborate answer for this? I have a similar issue where I have a dynamic page but would love to insert links and format the font with kerning & linespacing, etc but with the Rich Text box I lose all text formatting. Any ideas on how to get this going?

1 Like

@jessrightdesign

  1. You will have a DATABASE —> called “myDATABASE” (it’s the DB-ID).
  2. At first step you simply —> query your DB.
  3. Then you add some filtering methods, like —> eq(field, value), or contains()., or any other filtering method.
  4. Then you add —> ".find() after the filtering methods.
  5. After the query was created and all related values are found, you can get the result in the —> .then(()=>{}); - part of your code, where you can programm what ever you want, what to do with the found results.

How the code should look like, you will find in the VELO-API-Docs… see here…


import wixData from 'wix-data';
// ...
wixData.query("myCollection")
 .find()
 .then( (results) => {
 if(results.items.length > 0) {
 let firstItem = results.items[0]; //see item below
 } else {
 // handle case where no matching items found
 }
 })
 .catch( (err) => {
 let errorMsg = err;
 });
 

And do not forget to put all into the onReady() section.
You will have to modify and to optimize the shown example a little bit, till your new filtering function takes some action.

Convert the Text field type to Rich Content and you are able to format the text as required.

Tutorial form Wix here: