Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/15/2015 in all areas

  1. A client recently asked me to make a simple utility that they could use to upload files for public downloads. One of the requirements, for some reason or the other, was clean URIs. Thought it best to do it with PW. Too much of a mission anywhere else, really. Called it Dispo, which comes from Content-Disposition. Sharing in case anyone else may find it useful. This is generally for use on a subdomain - client wants it installed at files.example.com. In config.php, there are two options to set: one for the domain of the main website (Dispo will redirect there when the home page or 404 is hit), and the other for the name the company or, whatever. Best to set these as they default to localhost and ABC & Co., respectively. Create files using the downloader template, specifying a title for the file (this, along with the company name as set in config.php, will be used for the downloaded file name). When the entry (Page) is requested, its file will be downloaded. To view the file instead (if the browser is capable of it), add ?view to the URL. Download below: site-dispo.zip
    5 points
  2. <?php // An object is always equal to true in php. // For a PageArray do check for the number of elements. // For a Page one would check for the id. if ($page->blog_category->count()){ echo"Posted under: "; foreach($page->blog_category as $cat){ echo"<a href=\"{$cat->url}\">{$cat->title}</a></li> "; } } // Else do nothing. Not even loop though an empty array @Mike Rockett When using the new wire api function than do it the right way: echo "Posted under: " . $page->blog_category->implode(", ", function($cat) { return "<a href=\"{$cat->url}\">{$cat->title}</a>"; });
    4 points
  3. I think it's more suitable as default behavior to expand. It's looking more cohesive and sometimes one even doesn't want the user to notice the missing field. But I like the behavior more for two-column views. For three I'd rather have both columns expand the same size instead of only the second one expanding.
    2 points
  4. Hi everyone, Here's a quick little module that I hope you'll find useful. NB It requires PW 2.5.16 (or late 2.5.15 - this is the exact commit) It allows you can control display of the various Page Edit tabs by user permissions. So if you want to always hide the Settings tab for users of a particular role across all templates, this should come in handy. http://modules.processwire.com/modules/restrict-tab-view/ https://github.com/adrianbj/RestrictTabView You can approach this from two directions - hide from all users unless they have View permission, or show to all users unless they have Hide permission. It's up to you to create the permissions and assign them to roles. Let me know if you have any problems or suggestions for improvements. BTW - I am not sure how much use the Delete and View options really are in most situations, but they are there if you want them. PS Thanks to @LostKobrakai for the code in this post: https://processwire.com/talk/topic/8836-how-to-manage-delete-tab-for-user-groups/?p=85340.
    1 point
  5. Hey, after having Lightwire Skin more or less ready for some months now I finally created a little module to make the installation easier. I hope you like it. Please report issues directly on Github: https://github.com/NicoKnoll/LightWire-Skin A cleaner and nicer CKEditor Skin using fontawesome:
    1 point
  6. A very simple portfolio site for photographers, designers, textwriters. When its infished Ill upload the source to share with ya'll.
    1 point
  7. It's better, but I think 20-25 will feel more natural. Scrolling by touch is quite irritating on my Windows tablet and laptop on Chrome in that it doesn't slowly decellerate upon let-go. I wonder if you shouldn't upgrade to the newer jScrollPane... Their demo page (using 2.0.22) works as anticipated.
    1 point
  8. Hi Orlando - glad you found the MigratorWordpress importer useful. I assume the comments were imported automatically via MigratorWordpress? I think this is a bug in the module. The "Import Created / Modified Dates" settings is not working for comments. Was this your situation or was your initial comments import handled outside of MigratorWordpress? Either way, I'll add it to my list to fix this.
    1 point
  9. Hey @valan - sorry about that - it was a bug in Hide mode. I just committed a new version that should fix things for you.
    1 point
  10. If the requireIf selector is correct (maybe radios do only match by value and not the label) than this should work. The js doesn't care how the fields are set up if the pieces fit together.
    1 point
  11. Solved, i found the module preventing unpublishing, namely: Custom Page Permissions Seems that it was installed year ago when building the website. I have no clue what the reason for it was. Anyway uninstalling this module solved the issue
    1 point
  12. A webshop for a german music publisher. The good thing? They don't want fancy Payment Options, all they want is Prepayment. The bad thing? The german legal stuff...
    1 point
  13. $page->numChildren is a whole lot faster and more efficient than $page->children->count(). In a case like this, I would stick with numChildren. It's okay if it's occasionally wrong with published or otherwise non-accessible page inclusions. Also $page->children->count() is one of those things you really can't use at the large scale, because it has to load all those pages. If you just need to check if a page has accessible children (regardless of amount), you can do: $hasChildren = $page->child->id > 0; To count all visible children: $numChildren = $pages->count("parent=$page"); I'll add a $page->numChildrenVisible property in the next commit.
    1 point
×
×
  • Create New...