-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Store and retrieve templates to/from file system #227
Conversation
@WillStrohl @Timo-Breumelhof Since previous PR #194 was just too big for good testing, I canceled it and I'm moving some of those changes into earlier PRs (like #226 for removing hardcoded paths). I will also be creating additional future PRs for moving templates to host folder rather than desktopmodules, moving themes to host folder rather than desktopmodules, and packaging up the themes from dnncommunity.org. |
Ok seem logical, thank you:-) |
Per @WillStrohl recommendation, add try/catch to log any errors encountered during code-based upgrade.
…l_Or_Upgrade_MoveTemplates()
…te to module cache to avoid merge conflict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
@johnhenley These should be easy to remedy. :) |
done i hope :) |
Yep, we're good this time! :) |
Description of PR...
Editing and testing Forum Templates is cumbersome because the templates are in the database. File-based templates makes creating and maintaining templates much easier.
Changes made
Templates are now retrieved from .txt files rather than database
During upgrade, templates existing in the database table
activeforums_templates
are extracted to~/DesktopModules/ActiveForums/{theme}/templates/
based on the theme associated with the template's module instance. Templates not associated to a module instance are written to~/DesktopModules/ActiveForums/{theme}/templates/
Template files are named using the template's "title", e.g., ForumView.txt. If multiple templates with the same name exist within the same instance of the Forums module installed on the DNN host, the template file names are made unique by appending the ModuleId and TemplateId from
activeforums_Templates
to the filename, e.g., TopicView-43-18.txt.When loading templates at runtime, they are loaded from (in high-to-low priority order):
~/DesktopModules/ActiveForums/{theme}/templates/
~/DesktopModules/ActiveForums/templates/
~/DesktopModules/ActiveForums/config/templates/
(delivered templates)Templates can either be edited directly on the server or can still be edited using the template editor in the Forums module. The template file name is displayed in the template editor:
PR Template Checklist
Please mark which issue is solved
Closes #93