HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Simple Pages 1.0
Linc
Admin
I was brainstorming the dead-simplest way of doing "static" pages without any database modifications and came up with this. Probably not going to be adding more features to it any time soon. Should scale very well.
9
Comments
Excellent.
This is a cool little plugin!
Is there a reason you went with searching on not found versus adding a route?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
interesting plugin.... note:
only root admin can make a page since it uses a non-existing permission in vanilla 2.1
a possible tweak
CheckPermission('Garden.Community.Manage')
could be changed to
CheckPermission('Garden.Users.Edit')
a possible issue
editing page cause a duplicate discussion to be created as well, at least that is what I see.
A readme with some sample instructions regarding slug would go a long way for users.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Yes: routes don't scale. They'll bog down the config.php with a ton of text, which needs to get re-read on every request.
Also, a route will override controllers, meaning you could then break your site if you created a page at 'profile', for instance.
Good thoughts, @peregrine. I've now released 1.1:
I didn't see this happening on my test install of 2.1. Anyone else see this? What field(s) are you editing, specifically?
Presently, you wouldn't be able to retroactively edit a discussion to convert it to a page. Known limitation. However, changing the rest should work.
thx for the replies!
I went to the last discussion in the topics index and edited it. I'm on a localhost. vanilla 2.1.6
version 1.1 of plugin.
a step by step read me with some screenshots would be handy.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@linc
for the life of me I couldn't figure out how this plugin worked.
but as it turns out on my local host with vanilla installed in vanilla folder.
I had to change
to
now finally I can see it is a cool plugin.
I'm puzzled why it wouldn't work with standard code.
the original discussionUrl($result, '', false)
evaluated to "/vanilla/index.php?p=/discussion/221/testpage"
and I had to chop it to look like
/discussion/221/testpage
prior to dispatch otherwise I got page not found.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I probably neglected to account for subfolder sites.
was this auto-brainstorming or did you brainstorm in a committee.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I'm fairly certain the solution will be to simply wrap
discussionUrl()
withUrl()
.No it already does that. I actually see no difference between the result of your code and mine.
with yours
I get this being dispatched "/vanilla/index.php?p=/discussion/221/testpage" // doesn't work for me,.
but it doesn't like that at least with my localhost and /vanilla folder standard .htaccess
with my code snippets - I have this being dispatched - /discussion/221/testpage // which works for me.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I see. It's taking a double-fall from both the subfolder and the Rewrite not being enabled. Your fix is correct; my change is functionally the same.
aha - that explains it. your mod of my mod works for me as well and is cleaner.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I realized later after you mentioned Rewrite it (that I was testing for days with and forgot to change back)
$Configuration['Garden']['RewriteUrls'] = FALSE;
and that was the source of the issue.
but the change you made is more robust and seems to work for both
$Configuration['Garden']['RewriteUrls'] = FALSE;
or
$Configuration['Garden']['RewriteUrls'] = TRUE;
Although it still seems there may still be portions of vanilla that won't work correctly if you have
$Configuration['Garden']['RewriteUrls'] = FALSE;
is $Configuration['Garden']['RewriteUrls'] = TRUE; pretty much mandatory or do you want to hear about other things that may not work with $Configuration['Garden']['RewriteUrls'] = FALSE;
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I believe we are planning to switch to making RewriteUrls a mandatory setting in the future. I'm not sure what the current status is regarding our support for it. @Todd?
I've installed/enabled this, but am curious, is this a plugin that just works and doesn't have settings? I don't see any way of setting things up once I've enabled the plugin.
since there are no global options - there is no need for a settings page.
the settings are when you post a discussion. i.e. Show As Page for users with garden settings manage permissions.
Many plugins have no settings page, because there is no need.
perhaps one day - linc will attach a screenshot to the plugin, and user mysteries will be put too rest.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
on my localhost with forum installed in vanilla subfolder.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@peregrine Thanks, added it.
Also released yesterday's fix as 1.2, and added an icon.