Creating New SPA Page Problem

When I'm creating a new SPA page/route Wappler isn't inserting the "normal" code that it puts on the SPA pages.

Instead, it's treating it like it's own brand new HTML or PHP page.

I must be doing something wrong.

Here's an example of the code I expect it to put in:

<!-- Wappler include fontawesome_5="cdn" bootstrap5="local" is="dmx-app" id="RevLinkUser" appconnect="local" jquery_slim_35="cdn" moment_2="cdn" head-page="../mainpages/Home.php" components="{dmxBootstrap5Navigation:{},dmxStateManagement:{},dmxBootstrap5PagingGenerator:{},dmxBootstrap5TableGenerator:{},dmxFormatter:{},dmxBootstrap5Collapse:{},dmxBootstrap5Modal:{},dmxTyped:{}}" -->

But, here's the code it automatically puts in, instead (it also includes tags and things like that:

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" crossorigin="anonymous" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="../../bootstrap/5/css/bootstrap.min.css" />
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js" integrity="sha256-CutOzxCRucUsn6C6TcEYsauvvYilEniTXldPa6/wu0k=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="../../css/style.css" />
<link rel="stylesheet" href="../../dmxAppConnect/dmxBootstrap5TableGenerator/dmxBootstrap5TableGenerator.css" />
<script src="../../dmxAppConnect/dmxStateManagement/dmxStateManagement.js" defer></script>
<script src="../../dmxAppConnect/dmxFormatter/dmxFormatter.js" defer></script>
<script src="../../dmxAppConnect/dmxBootstrap5PagingGenerator/dmxBootstrap5PagingGenerator.js" defer></script>

How do you create the content page? Can you share the exact steps?

In my Project Folder, I will right-click on the folder I want the new page in and select, "Create Page."

Then I give it a name and click "Save".

File is then created with all of the content I shared above.

If I click on the "Move to include file" icon then click "Content Page" it asks where to put the file and what to name it.

So, I find a folder and click save.
It just adds a line like:

<div is="dmx-route" path="/Test2" url="Test4"></div>

But if you right click in the file manager and create a file, then it’s considered a full page, not a content page.

:joy: Okay, that's what I'm doing wrong... but...

Where am I supposed to click to add a new content spa page?
(I tried following the steps in the docs, but that's where I got what I did above)

Anyone?

Have you read this?

1 Like

That is the documentation I was using (that I referred to above).

But, I reviewed it again after you suggested it and see what I was doing wrong.

I was attempting to move the entire page into a content page. Apparently, you can only move a portion of the page to spa content.

Thanks!

2 Likes

I have one PHP project developed as a SPA. It has become more hassle than it was worth. I wish I had just used Includes instead.

Glad you got it sorted out.

2 Likes

I do, at times, which I was just doing plain ole' includes.

1 Like