Before I begin the CMS-test

The script I used to convert WordPress posts to markdown files:

… gave me this output. Will it matter when using the CMS feature?

That folder and file structure will not be compatible with the Elements CMS as it expects a flat file structure — your markdown files need to be directly inside the “posts” folder.

We are open to adding multi-level folder support in the future, but that’s won’t make it in to the first version.

Ok. Thanks @ben . Will be re-exporting my wordpress posts in a single folder format.

@ben To clarfiy Ben, will nesting folders work if they only include markdown files for the collection to detect? I’m only putting MDs into these folders; not images or otherwise. However there are sub-folders as I’m wanting to mirror my navigation structure.

All of the markdown in “cms-thingstodo” are single items - Page header content. But the sub folders will be “directories” of markdown for collections.

Current layout in Foundry 3 I am recreating using Elements and CMS: Eat and Drink - Visit Lawrence

Can I nest my files this way and reference the nesting folder content as a collection?

Top content of that Eat & Drink page will be a single item, but all the cards will be in the collection folder.

Yes! The Collection component will read in files from whichever folder you select, the folder can be anywhere in your project.

So you can select the “attractions” folder, and it will fetch all the .md files directly inside it.

Downloaded the Wordpress posts again and converted them into a single folder layout. Tried my best to repeat the instruction from @ben , but still got an error message on my page. I am sure I have made a basic error.

I suspect that the markdown frontmatter structure is not correct. It would be best if you showed one or two screenshots from a markdown file.

Maybe it’s due to the “coverImage,” but it’s honestly hard to say.

I also tried the import method, but quickly realized that’s probably not the right way—there are just too many places where errors can creep in.

My tip: start simple, with a really small .md file containing just two or three frontmatter sections. If that works, gradually expand the frontmatter until you have a complete template that functions as expected.

Then, copy this working frontmatter into your other .md files. If something breaks at that point, the error might also be in the markdown body.

I’ve found that, for me, importing all my Alloy markdown files doesn’t work—or rather, doesn’t work yet. The same is probably true for your WordPress import.

Thank you for looking into this and providing suggestions, @Pegasus . Not given up hope that @ben can chime in and provide some suggestions on how to more forward.

Sincerely,

Kjell Are

Maybe just post the markdown in a code block, it is difficult to read :glasses: from the image?

Hey @refsvik,

@logrunner is right… can you post a sample .md file here? you can do it inline using the code blocks. Or better yet, share you project with us!

Once we have that we can take a look and see why it’s not rendering for you :slight_smile:

Have sent a DM with a link to the whole project.

Sincerely,

Kjell Are

Also, here is the markdown:

-–

title: “Eit møte med det tyske Vitenskapsrådet”

date: 2023-04-18

categories:

  • “mer”

tags:

  • “code”

  • “internasjonalisering”

  • “lederskap”

  • “slik-lever-dei-der”

coverImage: “Skjermbilde-2021-11-18-kl.-17.50.25.png”

-–

Et møte med det tyske Vitenskapsrådet om studiekvalitet ved CODE – universitetet for anvendt vitenskap i Berlin

momenter som bør inn i refleksjonen:

- bakgrunnen for invitasjonen

- hva vi snakket om

- min rolle

- tanker rundt vitenskapsrådet i tyskland vs norske NOKUT

## 0\. Ingress

Her reflekterer jeg omkring…

## 1\. Beskrivelse

**_Beskriv situasjonen i detalj. Hovedpunktene som skal inkluderes her gjelder hva som skjedde. Dine følelser og konklusjoner kommer senere._**

- …

- …

- …

## 2\. Følelser

**_Utforsk eventuelle følelser eller tanker du hadde under opplevelsen og hvordan de kan ha påvirket opplevelsen._**

- …

- …

- …

## 3\. Evaluering

**_Vurdér hva som fungerte og hva som ikke fungerte i situasjonen. Prøv å være så objektiv og ærlig som mulig. For å få mest mulig ut av refleksjonen din, fokusér på både de positive og de negative sidene ved situasjonen, selv om det først og fremst var det ene eller det andre._**

- …

- …

- …

## 4\. Analyse

**_Analysetrinnet gir en sjanse til å forstå hva som skjedde. Frem til nå har du fokusert på detaljer rundt hva som skjedde i situasjonen. Nå har du en sjanse til å trekke ut mening fra det. Du ønsker å målrette de ulike aspektene som gikk bra eller dårlig og spør deg selv hvorfor. Hvis du ønsker å inkludere akademisk litteratur, er dette det naturlige stedet å inkludere den._**

- …

- …

- …

## 5\. Konklusjoner

**_Trekk konklusjoner om hva som skjedde. Det er her du oppsummerer læringen din og fremhever hvilke endringer i handlingene dine som kan forbedre resultatet i fremtiden. Det bør være et naturlig svar på de foregående avsnittene._**

- …

- …

- …

Try adding in the tag:

author: refsvik

and also changing the tag:

coverImage

to

front_image

With these changes, I was able to get the page to display OK.

Obviously, Elements needs to handle missing and incorrect tags a bit better BUT this is an early beta. :slight_smile:

Is the page extension set to be .php?

Probably not. Not sure I’ve been told to anywhere…

Ping. Everything works. And it takes 3 letters:

.php instead of .html file:

Maybe the use of CMS-components should come with a more specific warning for idiots like myself. That the use of the components, require you to swap the file to a .php to make it work? @ben @dan ?

What I don’t understand is why the CMS system can’t do this for you. If it sees the file is “.html” change it to “.php” for you. Or is one better off setting the default to “.php” and then never having to worry about it, or is there a downside to doing this?

We need to add a feature into the Elements API/Elements app that will automatically switch your page from html to php if it detects a component requires it.

It’s already on the to do list :stuck_out_tongue: