Xway PHP snippets and blog questions

Hi, I am a new customer (I have recently been training on the beta) and I am impatiently waiting for the release of Xway.
I need a contact form and a blog on my sites. Can you advise me on the options with Xway?
Likewise and last question, will I be able to integrate snippets to use php scripts and integrate my reservation calendar in php on a page?

Some contact form and blog suggestions:

  1. Hosting your own contact form has become problematic with anti-spam measures, but you can use an online form generator (see Spam Free Contact Form and Creating a Contact form). Alternatively, you can use a mailto link (Xway 1.0 has improved support for mailto links).
  2. Blog: you could do this in Xway (e.g. News page in the Xway tutorial), but I would suggest using a blog site (e.g. Blogger) and linking to that from your website.

Iā€™m not sure what is involved with snippets, but you can add HTML code via markup items.

You can add PHP using the Generic Markup section of the Page Inspector.

1 Like

Iā€™m thinking about pieces of code to integrate directly either in the ā€˜headā€™ or ā€˜bodyā€™ part of the HTML page. Iā€™m asking this question to find out if itā€™s possible in order to avoid having to input them directly on the published page and therefore having to re-enter them every time a modification is made under Xway on the page in question. Sorry for this question, Iā€™m a complete beginner with Xway (I do have experience with Dreamweaver, yes, it still existsšŸ˜±ā€¦ RapidWeaver, though weā€™re not really sure about it at the momentšŸ˜¬, and ā€˜the hard wayā€™ with TextEdit, Emacs (the Linux versionšŸ§), and VSCode).
ADD : I told you Iā€™m a Totally Newbie. Iā€™ve just found Markup things. Great :+1:

Hi Bruno,

You can add code via the Generic Markup, JavaScript Markup, and CSS Markup sections in the Page Inspector. Plus (as youā€™ve discovered) markup items can be placed anywhere on a page.

1 Like

Hi Jeremy,
todayā€™s dummy question: does xway handle .php extensions for pages? I tried to configure Sitelok from Vibralogix with the beta but it doesnā€™t work (renaming .html .php before exporting pages). Maybe an export issue while publishing is not enabled?

You should be able to give pages a .php extension by renaming them in the File Name field near the top of the Page Inspector.

Yes thatā€™s what Iā€™ve done. And I put snippets of code ā€œbefore htmlā€ in generic markup. Iā€™ll try again later with dev console and let you know the results. Thanks for your answer.

Have you uploaded your site to a server?

PHP is a server-scripting language, so it wonā€™t work if youā€™re previewing locally.

I use Mampro. When I give the .php extension to the pages of the site, only index.php is displayed in a browser, the other pages (built from the getting started manual) are not displayed, only a blue gray background. I do this test only by modifying the extension of the page, I have not yet modified the markup with the code from Sitelok.
For sitelok, I discovered the reason for its lack of functioning: each time I export the site to its directory it overwrites everything that is there, so the Sitelok files directory (slpw) disappears, which is annoying to make it work :joy:. The problem is that I can only recover the Sitelok code snippet after installing it in the root of my site and when I export the site again, it overwrites everything, no more sitelok directory :sob: sorry to start boring you right from the betaā€¦ imagine when Iā€™ll be warmed up for the release of version 1.0 :face_with_hand_over_mouth:

Mampro is a local server running under macOS?

I think that what you need to do is have a folder that is separate from Xwayā€™s Export folder, and put your sitelok folder here. Then when you have exported from Xway, copy the files from the Export folder (Select All, then copy) and paste them into the folder that contains your sitelok folder (replacing any files that you have previously copied).

Export synchronises a documentā€™s internal Site folder with an external folder. It doesnā€™t know about any additional content (e.g. sitelok folder).

Yes Mampro is a ā€œlampā€ for mac (or windows). Thanks for the tip with two folder. I have no clue about the .php issue, dev console doesnā€™t show any trouble. Really weird. I use Mampro for other php site tests : it works well. I donā€™t think itā€™s a Mampro issue. When I put back the .html to pages all works well again without any other change.

Can you give us some more information about what is happening with the PHP pages? They seem to publish OK for me.

I am running macos sequoia on a mac m2 ultra, mampro version 6 up to date, php 8 support (8.2 from memory, I am no longer in front of my mac at the moment). I created the site following the manual (which is very well done). Everything works perfectly in html. In the inspector, I change index.html to index.php (homepage) then news.html to news.php, etc. I export the site and only the index.php page is displayed correctly. The other pages (whether I call them from the navigation menu or with the full url in the Safari browser) are not displayed, only the gray blue background. If I put the html extension back in place and export the site again, everything works fine again.
ADD : I think this is not enough information to allow you to intervene effectively. I do not have the possibility to do better today, tomorrow I will build a new test site (a very simple one, three pages .php) with Xway and see what it gives. I will have time to test it also online on my test server. Thank you for your support, I will keep you informed tomorrow.

I havenā€™t used mampro, but I have run hundreds of different PHP servers over the years, and one thing you have to take care of in the configuration of the Apache server is to ensure that your default (index.html) settings also include index.php. You can actually configure it to serve literally any filename, any extension as the index page, so donā€™t feel limited to that naming convention.

The config line is DirectoryIndex, and it needs to be inside the <Directory /path/to/site/root> block somewhere, along with the Options Indexes line:

DirectoryIndex landing.html index.html index.php whatever.xyz

You can have multiple values for this configuration, and Apache will try them until it hits a match. I believe they are considered left to right in the space-delimited list.

Walter

1 Like

@waltd Thank you for the tip about extension and apache.

@Jeremy Found it! Safariā€™s cache (since the Sequoia update) is a horror. Although I always empty it between two tests (and several times during the same test), it continues to keep traces of what should no longer be there, in this case it looks for html when there is none left, ditto for php when I modify. I have to go through another browser until Mr. Safari stops doing anything. I took advantage of Waltdā€™s suggestion to check if the new version of Mampro (7) had not forgotten the extensions, yes, when you have other .php pages at the root of the site it was not indicated.
In short, thatā€™s it: Vibralogixā€™s Sitelok works perfectly with Xway and Xway works perfectly with PHP extensions. The problem was caused by Safariā€™s cache.
I find that what is happening with Safari and its cache management is a bit strange, am I the only one in this case?
ADD : nothing appears in dev console, so impossible to find it this way

Iā€™m not on Sequoia yet, but perhaps Reload Page from Origin would help?

Thanks for the tip. Yes itā€™s ā€œcleanerā€ but still some problems. I followed a friendā€™s recommendations and switched to Chrome, it works much better with the dev console, I no longer have any cache issues (Iā€™m keeping my fingers crossed anyway :crossed_fingers:).
Do you plan to release a complete manual on all the features of Xway (documentation on the inspector and its tools for example :yum:). I am starting to ā€œbuildā€ a blog (markdown articles ā€œretrieved and transformedā€ into html to display the list and articles) and that would allow me to go a little faster in my ā€œappropriationā€ of Xway. In the same spirit I think of ā€œmakingā€ a contact form linked to my sql database and ā€œbuildingā€ some effects like parallax, animationsā€¦ Iā€™ve already said that but Iā€™m very enthusiastic about Xway and all its potential. Itā€™s a great job :clap: Canā€™t wait to purchase v1.0 Iā€™m still pressing the pedestrian call button :wink:

There is a detailed reference manual which you can view by choosing Xway User Guide from the Help menu (in Xway).

1 Like