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

2»

Comments

  • peregrineperegrine MVP
    edited January 2015

    @Linc said:
    peregrine‌ Thanks, added it.

    Also released yesterday's fix as 1.2, and added an icon.

    thank you. I "approve" this plugin :)

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • ToddTodd Vanilla Staff

    @Linc said:
    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?

    We will be requiring url rewrites in the future, yes.

  • I recommend, explicit routes and route reversal for automatically updating urls, as other frameworks do. Implicit routes have their use but are limited, there is not reason to attach a particular url scheme to a particular controller. Of course implicit routes can be a fallback.

    It makes more sense to get the url from reversal like django than be limited to a fixed albeit relative url scheme.

    routes in config.php is limited, it would be useful to set routes in app or plugin as a configuration.

    However in this case the the not found handler is appropriate. When Linc says that routes are not scalable, they are not scalable if not well matched, but there is nothing wrong and quite a bit right with explicit routing if done well and appropriately. Many MVC framework make use of them as standard.

    grep is your friend.

  • Nice plugin!

    In the current version (1.2) the plugin performs a redirect from the discussion url to the "slug" url. However, the links in the forum are not changed, so this redirect has to be performed on every call.

    Therefore, I propose to change the forum links directly. Hence, the following code could be added to the plugin (based on the code for discussionUrl() in vanilla 2.2):
    if (!function_exists('discussionUrl')) { function discussionUrl($Discussion, $Page = '', $WithDomain = true) { $Discussion = (object)$Discussion; if($Discussion->Type=='SimplePage' && !empty($Discussion->ForeignID)) { $Result = '/'.$Discussion->ForeignID; } else { $Name = Gdn_Format::Url($Discussion->Name); if (empty($Name)) { $Name = 'x'; } $Result = '/discussion/'.$Discussion->DiscussionID.'/'.$Name; } if ($Page) { if ($Page > 1 || Gdn::Session()->UserID) { $Result .= '/p'.$Page; } } return Url($Result, $WithDomain); } }

Sign In or Register to comment.