Dynamic Content not working and no corresponding table on mysql database
Autor: Chris TaylorI am using version 2023.3.11 and trying to introduce a dynamic content page to allow users the abillty to update information directly themselves.
I have created user accounts, and followed the guidance on creating a page (as a PHP) with dynamic content and also login section. I have also created a new MySQL database with my hosting provider 123reg and as far as I'm aware defined the necessary X5 settings to use the SQL database.
I can upload with no issues and using the control panel everything shows as PASS, and I am seeing analytical reports on website use in the control panel. Using the phpadmin function in 123reg i can see a table which has been created for the analytical data capturing site/page access but there is no table related to the dynamic content as I would expect.
In the control panel I can see and access the dynamic content, edit the text and save but the changes are not retained and the original text is redisplayed. But with no associated table on the database I am not surprised.
It seems the dynamic content is not being added to the database and/or not exectuing the save when edited.
Any help would be grealty appreciated as I have exhausted my limited level of knowledge and experience, and as far as I can see I've followed the help/guidance.
The dynamic content object on the website can only be edited if the users are logged in.
----- Tutorials -----
How to work with the Dynamic Content Object
>> https://guide.websitex5.com/en/support/solutions/articles/44000884500
-----
How to enable users to edit website contents online
>> https://guide.websitex5.com/en/support/solutions/articles/44000884845
-----
How to define default contents for the Dynamic Content
>> https://guide.websitex5.com/en/support/solutions/articles/44000885047
----- Screenshot -----
If at WebSiteX5 under ...
5 Export > Export website to the Internet / Parameters
_____/ data management /____
... the database has been set up correctly, then nothing further needs to be done for the “Dynamic Content” object.
Don't forget the "Login & Logout" object so that it also works with the "Dynamic Content" object.
-----
Login & Logout Object. How to add a login field for the users
>> https://guide.websitex5.com/en/support/solutions/articles/44002291373
-----
Autor
Daniel, many thanks for all the information shared and whilst this is the reference documentation which i had been using I went back to basics and followed each step precisely in setting up new user accounts, a login page and a new dynamic content page.
However this is still not working, and I have even tried working with both a save to file or save to database approach, but it makes no difference.
There is still no table being created on the MySQL database, although the site use analytics is there an working OK. There is also no file being created on the sever within the folder I've set up snd ot just remains empty.
Also when I login on the site it when the page refreshes post login it still prompts me to login as though it hasn't actually logged in, BUT the dymanic content is editable so it clearly has. I can then update the text but when i save it it reverts to the original text.
i have alos tried using the control panel, and this reports eveything as a PASS on the website test. i can also access the dynamic content, update it and save, but it still reverts to the original.
I think the underlying issue is no table or file is being set up either as the site is uploaded or when and update is applied to the dynamic text.
i am out of ideas people ........
Autor
Also I have now updated to the most current version of X5 Pro
I have now tested the “Dynamic Content” object on another test page with the current Pro version.
The “Login & Logout” object was already present in the header.
I set “Data sending to a file” and specified “/dynamic-content” (with a slash at the beginning) as the directory name.
However, this directory must be created yourself in order to save it with the "Dynamic Content" object. To do this, click on the right symbol in the target directory under "Export the website to the Internet" and the FTP window will open. Click on the "Folder+" symbol at the top and enter the directory name (without a slash).
Test page >> http://finde-links.de/test123-beautyblog/dynamischer-inhalt.php
------
-----
Autor
Daniel once again thank you for your continued support in trying to help me resolve this matter.
I have followed your guidance and even used the same folder name, but it is still not working for me.
The new "dynamic-content" folder is set up in the public-html directory via the cpanel with my provider (123reg). However the folder is empty and remains empty after any update to the dynamic text, but that is really no surprise as the default text is not updating.
I have tried creating new user accounts but this has no impact.
I have created a new page (php) with the login and dynamic text displayed together, and when I login I can see this works as the url updats with a "loginstatus=1" and the dynamic text box opens up to allow the text to be edited.
I then overtype the text with new content, but when I click on the "save" button the page just seems to refresh, and i am no longer logged in and the text reverts to the default text. It looks to me that the save button is not executing any code other than to reload the page to the original point and user not logged in. Interestingly though this seems to mirror your screen shots (other than your dynamic text is updating) as after the update your user has also been logged out based on the header content.
Using the control panel everything is still shown as pass so both the folder and sql database are still OK, indeed the site analytics are being updated to the sql database.
Unless you or anyone else can see based on my comments above then I think we need to just accept for some reason it will not work and I'll consider using an embedded google docs item which is very far from ideal for the users who would rather logon via the site or the control panel.
Daniel once again many thanks.
After saving the change, my login remains, see screenshot below
The Incomedia employees will be online during office hours in Italy from Monday, so maybe they know where to look for the problem.
I actually set up the test page with the "Dynamic Content" object quite normally in WebSiteX5 and also created the subdirectory for storage in WebSiteX5 using the FTP window.
I didn't do anything with CPanel or other external tools.
-----
Autor
Thanks Daniel
I set up everything, following your guidance, within WebsiteX5 and my comment about CPanel only referenced the fact i could see the folder had been created and equally the sql server was there, and this was further confirmed by the websiteX5 control panel which reports everything as PASS on the website test.
it is interesting that when i login it doesn't display like your screenshot with thr user name and definately logs out the user after an attempt to update the dynamic text.
Also interesting is the fact if i try to update the dynamic text from the control panel that doesnt work either, and now i have removed the various pages from the site and in the public-html directory the control panel is still showing me the dynamic content available for edit but when i click to open it goes 404 as the page has been removed but no idea why it shows it in the first place.
With my limited knowledge it seems like some code is missing or not being executed and lets hope the guys in Italy have some ideas as this would make things much easier for my users.
Thank you again for your help.
I can also edit the “Dynamic Content” object via the admin area, clicked on the “magnifying glass” icon and I am redirected to the page with the “Dynamic Content” object and there is also an automatic login, see screenshots below
The change is still present after logout and for visitors to the site, see
>> http://finde-links.de/test123-beautyblog/dynamischer-inhalt.php
If the "Dynamic Content" object does not work on your website, Incomedia employees, moderators or other users may be able to identify the possible causes.
-----
-----
Autor
Thanks Daniel, lets see what the Incomedia guys come up with.
i'll bet its something really basic I've missed or overlooked somewhere.
if i get a resolution i will post it here, I'm almost wondering if I should save the sites I administer and unistall the application, then reinstall and import the sites to see if a full installation does something, but we'll see what the Incomedia guys suggest.
Hello Chris,
depending on your configuration, the Dynamic Object should generate either a table with a name such as xx_yyyyyy_6_02_content, or a .txt file such as dynObj_6_02 in the directory that has been specified, contained within your root directory.
No specific configuration in the object is needed otherwise.
Could you please provide me with a copy of your project?
I would like to check if, hosting your project on a WebSite X5 web space, I encounter the same situation, in order to identify whether something may have been corrupted in the object, or whether your server is not interacting as intended with the writes from this object.
You can export the project in Step 5 - Export, choosing the Export the project option to generate an IWZIP file.
You can then upload the file with https://www.swisstransfer.com/ or similar services, and send a download link to sales @ incomedia.eu (without the spaces).
Thank you.
Eric
Autor
Hi Eric,
Thank you for your help in trying to resolve my issue.
I have created the IWZIP and uploaded to swisstransfer, and emailed the lonk as requested for you attention.
Chris
Hello Chris,
upon examining the project, the issue seems to lie with the Login/Logout not working as intended because of an interaction with Cookiescript.
If I remove the HTML object in the footer, when I log into the page with the Dynamic Content, the result is that a text with your username and the logout button should appear, whereas on your current version of the website this is not the case, because the login has not actually worked.
I tried to test whether the situation changed by using a Cookiescript object instead of an HTML Code one, however an error about your Cookiescript code appears, so I would suggest checking if there was also another code available that supports https.
Eric
Autor
Hi Eric,
Thank you so much for identifying the root cause, and I have taken steps to update the sites i administer both of which (unsurprisingly) had the same issue. Everything now seems to be working and I will investgate a solution for the cookie code which does not impact the login/logout feature.
This will make my role so much less in keeping these sites updated and allowing multiple users the ability to make their own changes.