I used includes for stylesheets or any other scripts i might have to use in the future.
So normally the structure would be adding the include above the head… as image below.
Please note im only using / AppConnect nothing else for the testing
Sorry it seems you need to use <?php require_once 'stylesheets.php';?> if you want to keep using a include in the but the only problem then is it wont “render” the content in Wappler
As far as I know PHP Includes are used to place reusable content inside a page body and Wappler is keen enough to see that it has to move the include to the body part.
To include custom style sheets you may use “attach style sheet”
I mentioned this or a similar problem quite a while ago - in relation to using a PHP include in the <head> section - eg for meta tags. This does seem to be a problem which should be fixed.
In the case of your javascript example, couldn’t you just use a link to a .js file rather than a .php file?
Hi TomD … thanks for the reply… i did do a search but could not find your topic… maybe my search tags did not correspond with your post
The same goes for my Javascript file. I like keeping the javascripts in files for debugging and easy to change in a file archive. or just script it out… lol… just my silly way of doing this… and not keep 1 very very long js file…
I couldn’t find my post either. Essentialy, it concerned a problem where the code was rewritten on closing/reopening a file, making it impossible to use a PHP include for meta tags - similar to your problem. It seems this is still a problem.
I've found the topic I raised about this in January. I found it by looking in my profile. The topic doesn't seem to be searchable. I don't know if this is intentional or a problem with Discourse.
hi Ben… thanks for they reply. The problem is… “include_once” seems not to “render” in design view. Ok let me see test the “include_once” and give feedback.
thanks for the Link TomD … lets hope @patrick or somebody gets back to us on this… as you said… don’t know if this is intentional or a problem with Discourse.
Wappler can’t render PHP code, it renders only the HTML in design view. The only exception are the server-side includes created in Wappler, the HTML from those files are injected in design view to render correctly. Any other PHP includes and/or HTML generated with PHP code will not be rendered/visible in the design view.
It should indeed not be moved out of the head, that is a bug, didn’t know this was still not fixed. Does this still happen in the latest version of Wappler?
Hello @Teodor, can this be done also for .NET implementation?
Sorry for hijacking this post @Mozzi, everyone. Just want to implement the same for aspx.