Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/06/2015 in all areas

  1. Go to your URL field settings (Setup > Fields > your field) and check the box to "allow single/double quote characters in URLs". That should fix it. We started not allowing those characters in URLs by default because such URLs could be a security problem if someone forgets to enable the "HTML entity encoder" text formatter for their URL field, and happens to output the URL in an href attribute.
    3 points
  2. Actually I just realized I might have been a bit confused by what you want - I thought what I wrote answered the first sentence in your question, but the second sentence suggests you want to hide the pub/unpub action buttons, in which case try this in your ready.php $this->addHookAfter('ProcessPageListActions::getExtraActions', null, 'hookGetExtraActions'); function hookGetExtraActions($event) { $page = $event->arguments[0]; $extras = $event->return; if($page->template->name == "basic-page" && $page->hasStatus(Page::statusUnpublished)) { unset($extras["pub"]); } $event->return = $extras; } You can remove the page status check for unpublished and also add: unset($extras["unpub"]); if you want to remove that as well.
    2 points
  3. It's actually wp-{all} or, to be more specific, wp-<admin|content|login|includes>{all}. The point of my previous post was to make a special wildcard, perhaps called {wordpress} for easy redirection to something funny.
    2 points
  4. // set new default language $default = $languages->get('german'); // redirect if (!$user->isLoggedin() && $page->localUrl($default) != $page->url) $session->redirect($page->localUrl($default));
    2 points
  5. Unfortunately this is not possible with built in permissions. Only the other way round is possible. You can add some permissions manually which are known by PW. page-publish: Publish/unpublish pages or edit already published pages. When installed, editable() returns false, when it would otherwise return true, on published pages, if user doesn't have page-publish permission in their roles. page-hide: Hide/unhide pages page-edit-created: Edit only pages user has created page-rename: Change the name of published pages they are allowed to edit user-admin-all: Administer users in any role (except superuser) Have a deeper look here: https://processwire.com/api/user-access/permissions/#optional-core-permissions
    2 points
  6. Hi everyone, This is an early (but mostly functional) version of a module that I am experimenting with for automatically populating all empty fields on a page. It is designed for use during site development and should be uninstalled once the site is live. https://github.com/adrianbj/AutoContent (anyone have an idea for a better name?) It currently supports the following field types: Text - outputs "This is an example Field Label", where "Field Label" is the label for the field Textarea (RTE and plain) - configurable content from http://loripsum.net/ and embedded images from http://lorempixel.com Datetime - honors output formatting and returns random date/time with configurable min/max datetime Integer - honors min and max settings Float - honors min, max, precision settings URL - returns a random URL Email - returns a random email address Image - you can specify image category (people, nature, business, etc), and the range for min/max number of images to generate. Page - creates runtime selected child page content for output - not well tested yet. MapMarker - not well tested yet! I will be adding support for Profields and other selected 3rd party fieldtypes shortly. Highly configurable content is provided by: http://loripsum.net/ http://lorempixel.com/ https://github.com/fzaninotto/Faker Generated content can be localized to your region - very handy for addresses, people's names, phone numbers etc: Many fieldtypes are configurable via the Input tab on the field's config settings, eg: Textarea: Text: Images: Datetime: In general I am designing this to work with minimal/no configuration so you can install and have all fields on all pages on your site immediately populated for testing layout and styling without the need for manually adding dummy content. There is also a dummy page batch creator and deletor (automatically tracks and deletes just the dummy pages) available from the module config settings page. Please let me know if you think you will find this useful - trying to get an idea of how much time to put into support for additional field types.
    1 point
  7. On one site I added a little bit of code to just keep a track of page visits. For fun, I also added it to the 404 page. Over the last month I have had over 1000 hits to the 404, which made me wonder who was getting my site addresses so wrong. Obviously, this is a terribly course tool and does not tell me anything other than it is being hit. So, being curious, I chucked an email at the hosting provider, asking them if they had a clue from their logs (i am terrible at reading logs) Yes, they said. The vast majority of 404s are being caused by people trying to hit the following page: mydomain.com/wp-admin Now, what a surprise!
    1 point
  8. I think you should be able to achieve what you want by hooking into Page::editable I think this should do what you are looking for - just edit the template you want to match. Keep in mind that in this form it will even prevent superusers from editing the page, so you might want to check that before adding the hook $this->addHookAfter('Page::editable', null, 'hookPageEditable'); function hookPageEditable($event) { $p = $event->object; // in case there is already a defined exclusion for this user's role for this page if(!$event->return) return; if($p->template->name == "basic-page" && $p->hasStatus(Page::statusUnpublished)) { $event->return = false; } else { $event->return = true; } }
    1 point
  9. Adrian, sorry, I don't even remember what project this was I've tried to go through some of my past projects, which could have been it, but I haven't found anything. New thread with wha you need might be better way to be lazy
    1 point
  10. Handy tools log your 404s with http://modules.processwire.com/modules/process404-logger/ edit redirects (includes a hitcounter) with http://modules.processwire.com/modules/process-redirects/ or (wildcard redirects possible like wp-*) http://modules.processwire.com/modules/process-jumplinks/
    1 point
  11. Updated module on dev branch. New features for v.0.0.9 dev branch : Added hook method ___beforeRender(), you can check hook example for usage Added multiple icons library use option Added Ionicons Library Now module using cdn for load icon fonts Also if you need custom icon font options you can use berforeRender hook ! After some test i will update also master branch. if you want to make test, you need to download and update it manually.
    1 point
  12. Actually, perhaps Processwire should come with optional pages for wp-admin and a couple of other WordPress standards that are nicely written and polite. "Should have chosen Processwire."
    1 point
  13. Looks like a great place to place ads
    1 point
  14. A variant of the IF statement section from the above example that checks whether a Tweet is a retweet, and displays the appropriate author information. if ($i < $limit){ $text = convert_links($tweet['text']); $timestamp = date('F j g:i a', strtotime($tweet['created_at'])); echo '<li>'; if ($tweet['retweeted']){ $author = $tweet['retweeted_status']['user']['name']; // Other Person $handle = $tweet['retweeted_status']['user']['screen_name']; // @otherPerson $text = substr($text, 3); // Removes 'RT ' from the beginning of the Tweet } else { $author = $tweet['user']['name']; // You $handle = $tweet['user']['screen_name']; // @you } echo $author.' @'.$handle.'<br>'.$text.'<br>'.$timestamp.'</li>'; } Note that the above requires the following change to MarkupTwitterFeed.module (line 138) to work : 'trim_user' => false, // include user details, because user details are useful
    1 point
×
×
  • Create New...