Forum Placed with Shortcode in Kadence Blocks Tab Loses All Formatting
-
I am attempting to insert the forum shortcode [forum forum=”2″] in a Kadence Blocks Tab module.
When I do the forum loses all formatting and becomes a text only version of the form where the links do not do as expected.
Do you have any suggestions as to what I could do to be able to embed forum using the shortcode above in a Tabs Module?
Thanks
-
Hi @asgaros,
I prepared a snippet that would allow to exclude the page used for your URL rewrite functions from the filters used by Permalink Manager to force the custom permalinks. Here is the code:
function pm_exclude_forum_page() { global $permalink_manager_uris; // Get the "Forum" page $asgarosforum_options = get_option('asgarosforum_options', array()); if(!empty($asgarosforum_options['location'])) { $forum_page_id = (int) $asgarosforum_options['location']; if(!empty($permalink_manager_uris[$forum_page_id])) { unset($permalink_manager_uris[$forum_page_id]); } } } add_action('init', 'pm_exclude_forum_page', 9999);
I added it also to the plugin documentation:
https://permalinkmanager.pro/docs/third-party-plugins/asgaros-forum/The snippet works for both Permalink Manager Lite & Pro versions.
Best regards,
Maciej-
This reply was modified 5 years, 10 months ago by
Maciej Bis.
Hello @mbis
Thank you for your snippet which I want to include as a compatibility-fix in the next version of Asgaros Forum. I saw that you provide a few additional functions regarding template-redirects in your documentation-link. I assume that I should include them as well to prevent some additional executions done by Permalink Manager, right? I ask because based on my testing-results with the code you provided before everything is working fine as well.
Hi @asgaros,
I did some additional changes in the snippet. Here is the new version:
https://gist.github.com/maciejbis/502159d344a1579b5e9cdad25cc3750bThere is one problem still – if the [forum] shortcode is used on a page where a custom permalink is used. The forum links inherit the base from the page, but they are also accessible via default permalink inherited from “Forum” page that can be selected in your plugin settings. I wonder if that is a good idea, as theoretically it could cause some “duplicated-content” SEO issues if more than a single canonical link is assigned to one forum/subforum page.
Best regards,
MaciejHi @mbis
So actually the little code of your Gist is the only required compatibility-code to ensure that everything is working fine and the code in your post before is not necessary anymore?
The location is used for two purposes:
– In case that one of the forum-widgets is used, it tells them on which page-id the forum is located. This ensures that the links are generated correctly to point to the correct forum-page.
– Now there is also another use-case: While most of the users just use a single forum, there is also the possibility to use multiple instances of the forum on different pages based on shortcode-parameters. So for example page A only shows category X, while page B only shows category Y. Because of this, Asgaros Forum also checks on-the-fly if the current pages-content contains a forum-shortcode and updates the location-ID in this case, to ensure that links point to the correct location.Additionally, I also do checks to verify, that the current page contains a forum-shortcode. This should ensure, that scripts and certain forum-processings are only executed/included on the current page if necessary to increase the performance for non-forum sites.
I know that the current logic brings risks for incompatibilities with other plugins, but at the moment its the only reliable solution to detect forum-instances and to ensure, that forum-logic is only loaded/executed if really necessary.
Hi @asgaros,
yes, I did some tests on my development server and this single hook is enough. I noticed that you use some custom function that parses the URL, but it is triggered after Permalink Manager filters the WP_Query object.
The only problem was that my plugin tries to correct the non-canonical permalinks and the URLs with /forum/ endpoint are treated like so. The single function in my Gist snippet stops any redirect functions triggered by my plugin.
Anyway, I noticed another issue not related to my plugin. Apparently, it is not possible to use [forum] shortcode inside custom post type single items content.
Best regards,
Maciej-
This reply was modified 5 years, 10 months ago by
Maciej Bis.
Thanks again for your feedback. I will add the required compatibility-code in the upcoming v1.14.9 release:
https://github.com/Asgaros/asgaros-forum/commit/be8555ed203ef5cd406ae4be80bf669028279976Some information:
1. The Toolset Types plugin (www.toolset.com) stops the ability to create a new Topic in the Asgaros Forum. When you click the submit button the destination is a “Page Not Found” error. I am contacting Toolset and notifying them of this issue.
2. When I use the Asgaros forum shortcode [forum forum=”2″], it is showing the results of the [forum] shortcode (i.e. the entire forum) and not just the forum associated with the forum=”2″.
3. I have done the testing with deactivating all plugins and these problems persist.I hope we can get this solved! Thanks very much.
Hello @forson
Do this problems occur after you have replaced the current installation with the current development-version (which includes all discussed compatibility-fixes)?
You can find the development-version here:
https://github.com/Asgaros/asgaros-forum/archive/d55ace4aca1aa54106b72f548f7184a1bf1a21c3.zipDear @asgaros ,
1. The [forum forum=”2″] shortcode now works and distinguishes between the main forum and the sub forum.
2. I cannot create a topic – everything works until I click the topic submit button then it returns me to an error 404 page…So if the forum is on URL:
https://www.domain.com/forum/forum/cnn/ and I try to create a topic from there and click submit, I am returned to:
https://www.domain.com/forum/forum/cnn/
but this time this link is a 404 not found page3. When I disable the Toolset Types plugin I am able to create a topic. So there must be some bad interaction between your plugin and Toolset Types…
4. Is it normal that when you delete the plugin all the forums and topics are deleted as well?
Thanks
-
This reply was modified 5 years, 10 months ago by
Forson.
Hello @forson
What you described again sounds like a issue caused by permalinks because normally Asgaros Forum doesnt really care if there is a slash at the end or not because WordPress itself redirects back to the default behavior.
I suggest you again to contact the developers of this plugin. I am not able to reproduce this issue because it requires a paid license. Maybe they have another idea on how to fix it.
Uninstalling the plugin via the WordPress plugin-screen removes the plugin itself and all data created by it to ensure that no “trash” is left-behind from a plugin which is not used anymore. A safe way to update/downgrade or change to a specific version is replacing the files directly on the server via a FTP-application or – in case its an official update – using the WordPress updater.
OK @asgaros
But one more example
https://www.domain.com/forum/ from here try to select a form and create a topic then click submit, I am redirected to…
https://www.domain.com/forum/forum/cnn/ which is a 404 error page.It is just this last issue that is holding me up. Do you have any other ideas of where I could look? This error is reproduced whether I am using the PermalinksManagerPro plugin or not….
Thanks
Based on your example I assume that “cnn” is a forum inside of a category, so the url-structure actually looks perfectly fine.
The 404 error-message means, that WordPress is not able to find any page in general which belongs to the URL. That actually means that some other plugin/component registers matching rewrite-rules which are prioritized before the forum-rewrite-rules – it is not able to find the corresponding content (because basically its a rewrite rule of Asgaros Forum) and throws the 404 error.
You can try the following things:
– Maybe there is a third plugin causing this last problem. Again, deactivating other plugins should help to verify this.
– You can also try to again save the permalink-settings in Settings -> Permalinks (without any changes to it) after deactivating the Permalinks Manager Pro plugin.
– If this also not fix this issue, you can try to disable SEO-Friendly URLs in Forum -> Settings -> URLs.Dear @asgaros
1. Resaving the permalinks did not help;
2. Disabling the SEO Friendly URLs in Forum settings did not help;
3. The only plugin that causes the Forum issue is Toolset Types;
4. I have contacted the Toolset Tech support and hopefully they can debug this issue.I will keep you informed and appreciate all your help.
Many thanks
-
This reply was modified 5 years, 10 months ago by
- The topic ‘Forum Placed with Shortcode in Kadence Blocks Tab Loses All Formatting’ is closed to new replies.