Jump to content

marcus

Members
  • Posts

    289
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by marcus

  1. If I understand it correctly, this is not yet possible in a native way, but part of Ryan's plan for the future, see: https://processwire.com/talk/topic/6514-implement-yet-another-way-to-access-pws-globals/?p=63773
  2. Yeah, although the flags set by the module are "personal" ones (as in: associated with a user account). In my site profile, I solved the "public" flag situation by adding a boolean-like field to pages (with template wiki-page in this case), calling them "Sticky pages". Maybe an idea for another module (but I'm quite certain that such a modue already exists). PS: I chose the sprintf way Setting labels is much easy now, see updated post above.
  3. Looks like a typical automated domain grabbing. Does your customer usually have to auto-renew his domain at his hoster? Does he own the trademark of "Body salvation" and can apply legal charges? But frankly, pwired, I strongly doubt ProcessWire General Support is the right forum for this since it has nothing to do with PW.
  4. Absolutely. The module should offer generic flagging ability to every site or app with a user system and maybe a large number of data entities. edit: Since user are pages this might work with little tweaks on user profiles as well
  5. Sorry for the double posting. Here's the aforementioned module, "FlagPages": https://processwire.com/talk/topic/7044-release-flagpages
  6. Hi there, remember my Knowledge Base Site Profile? In there, I implemented a simple "internal bookmarking system", but hard-wired it into the templates then. In order to start rewriting this mentioned profile I made a module out of this page flagging thingy: https://github.com/marcus-herrmann/FlagPages/ With this module, a logged in user can flag/unflag pages, on whose template the flag link (see below) has been placed. These flags serve as "personal bookmarks" and are not a site-wide sticky setting. It's a proof of concept and not heavily tested, still! So please use with caution. Usage On the module's config page you can set the user roles allowed to flag pages. Per default this ability is restricted to "superuser". If you are adding further roles, please seperate the entries with whitespace: superuser editor foorule On the markup side, FlagPages module consists of two parts: Rendering the link and rendering a list with your current bookmarks. First of all, load the module via: $flag = $modules->get("FlagPages"); Rendering flag toggle linkThen, use the renderLink method and place the output in your template. By adding the link to all or just certain templates, you can control which templates can be flagged and which can't. echo $flag->renderLink(); The default output will be "Add {Name} to flags", or "Remove {Name} from flags". You can override these labels with parameters. For example: echo $flag->renderLink("Add %s to my bookmarks", "Remove %s from my bookmarks"); Rendering the flagged pages list echo $flags->renderList(); This will output a simple unordered list with links to pages the currently logged-in user has set a flag to. Installation Requirement: ProcessWire 2.4 (although I haven't tested it in older versions, frankly) Manually Download or git clone, rename the module folder to "FlagPages" and put it into your site/modules folder Go to modules overview page and click "Check for new modules" Install the module. The module will appear under "Flag" section. Download here Have fun! edit: Simplified renderLink param logic according to teppo's advice
  7. Hi guys, recently, I'm reading Stephen Hay's "Responsive Design Workflow" and am fascinated by its idea of "Content reference workflows". In short: this approach does not use any software like OmniGraffle, MS Visio, etc. but plain HTML. This way the wireframes can be responsive (and be created quickly since one is at home in HTML anyway). The other thing is, that these type of wireframes are very minimalistic and, instead of a detailed graphic-design-like approach, it more or less uses two colors, borders and labels. So the danger of mistaking these wireframes as a design proposal is minimized. And since metaphors are always good I tried to tweak this philosophy with a well known instrument of the "analogue" world: blueprints. This way, at least thats the intention, it becomes even more clear for the customer that this is an abstraction. If you communicate it right, for example with a explainatory popup/modal, no customer ever should misunderstand it and ask: "What? My website is meant to be blue?" Find some screenshots below and a demo of what I'm aiming for here: http://demo.marcus-herrmann.com/blueprint-wireframes/ Before I confront any more customers of mine with this approach I would be very thankfully to hear any feedback on this from fellow developers. What is your (or your employer's) approach on this? Are there any obvious quirks with this one? As usual, you can find the code on GitHub: https://github.com/marcus-herrmann/blueprint-wireframes Have a nice weekend! Marcus
  8. I agree. Site profiles seem to be the Unique Selling Proposition of PW, because they can demonstrate what is possible within a few seconds. But better not learn from my code - it was written in a rush and seldomly "best practice" way. I had to hurry it within a few hours to set up a office internal wiki and therefore took some shortcuts (like purecss, for example). Though it was written three months ago, if I had to start over, I would choose another template logic, would write a module that creates a wiki-user role, a module for the internal bookmarks and so on. Stuff and approaches that weren't on my radar/skillset back in March. And, I do not consider myself as a proper PHP coder, merely as a beginner trying to learn. So looking into soma's code for example would be the better idea /edit: nevermind. Totally mixed PW Weeky issues up. It's way too hot here in Berlin right now...
  9. But Ivan is right - I could really publish it there: http://modules.processwire.com/categories/site-profile/ Will do it, but with a big "This! Is! Alpha!" warning sign The very rudimentary state actually kept me from putting it there until now. But thanks for the feedback
  10. Oh, this is perfect timing! Taking this for a test drive as soon as possible. Lately, I was aiming at the exact same thing. But this looks perfectly done with the possibility to plug in your favorite template engine! Thanks, Wanze!
  11. marcus

    Hashcash

    When I was testing it, the django demo took about 3 - 4 seconds, which could be acceptable in some situations. Solving a captcha would at least take the same amount of time, but would bear the potential of errors. 10 - 15 s is way too much, I agree.
  12. marcus

    Hashcash

    Haven't found the the time to look into this in detail – but it sounds interesting at first glance (and maybe PW-module-worthy). Any expericences?
  13. Try $p->find() instead.
  14. Looks like you're looping through $gigs and $gigspast, but are trying to output $heute directly. Though it's unusual to have several gigs on one day (I guess, don't know the band ) $heute will return a page collection. Try either foreach($heute as $gigheute) { ... } and better rename them vars, or outputting $heute->first()->Datum. edit: Fixed typo
  15. Thanks for the hint! Looks very sophisticated, will look into it!
  16. If anyone needs to easily change Modestas main color, I forked it and added a little setting: Download: https://github.com/marcus-herrmann/AdminThemeModesta
  17. Hi altogether, since I am currently working on a project that has (hopefully) the potential to reach a certain level of complexity at some point, I wanted to start the template structure in a scalable and "proper" way. In the following I'll try to give a summary about the approach I'm testing: 1. Directory structure inside site/templates/ /controllers/ /views/ 2. Create init file named... site/templates/init.php...containing (for example): <?php function getPartial($name, $allpages) { // Site wide $settings = $allpages->get('/meta/settings'); $root = $allpages->get('/'); // User related $loggedInUser = wire('user')->isLoggedin(); // Page related $title = wire('page')->title; $children = wire('page')->children; $template = wire('page')->template; include($config->urls->templates . 'controllers/' . $name . '.php'); include($config->urls->templates . 'views/' . $name . '.php'); } 3. Uncommenting prepandTemplatefile in /site/config $config->prependTemplateFile = 'init.php'; 4. Creation of partial (controller and view) in their respective folders /site/templates/controllers/test-partial.php /site/templates/views/test-partial.php Example controller: <?php $homepagetitle = $root->title; Example view: <h1><?= $homepagetitle ?></h1> <p><?= $title ?></p> 5. Creation of layout file. I tried to put these in a folder called /layouts, but that does results in PW not finding new templates anymore in the PW Admin when creating a new templates. Any ideas? Changing index.php's $config->urls->templates ? Example layout: <html> <head> <title>Foo</title> </head> <body> <?php getPartial('test-partial', $pages); ?> </body> </html> So, for some reason I have to explicitly inject $pages or wire('pages') into getPartial() - but I have no idea why, since $page or wire('page') is working without problems in the functions scope. But: The output is just as intended. The title of the root page in a h1 headline, and the title of the page using this "layout" in a paragraph. Any feedback or pointing to pitfalls of this approach would be highly appreciated Best, marcus edit: Funny, essentially this is a very stripped down way of Template Data Providers, which needed Twig the last time I tried to use it.
  18. It doesn't have a theme system - but that means you can style it without any restrictions whatsoever. Stylewise, the better your HTML, CSS skills are, the better PW "theming" outcome is.
  19. Hi mosravo, different to Wordpress and others, ProcessWire has no "theme as a package" logic. Its philosophy is to provide a content framework and an easy API, where a clean WordPress install confronts you both with a certain content logic (pages vs. articles) and a certain theme installed (and the call to action to download/try more themes). So, if you discover certain projects and sites being realized with PW, the chance of this being a theme (as in: free download provided somewhere) is close to zero. But still, these projects can serve as a showcase for what's possible with PW. Maybe lets compare it to a (fictional) lego product: one is already assembled on purchase and has 3 or 4 big chunks of lego bricks (and you still could go to nearly every single brick if you want to) - that would be WordPress. ProcessWire is more of a box of bricks of every possible form, preassembled if you want to ( = site profiles) but foremost provided with plans of possible outcomes ( = this forum, and the docs). But still, you have to "now your lego" to at least a small extent minimum.
  20. In case you're looking for a system that allows logged in users to flag/like and unflag/unlike certain pages, please have a look at my rudimentary site profile here: https://processwire.com/talk/topic/5984-release-rudimentary-knowledge-base-site-profile/ - unfortunately it isn't a module ( - yet, since I'm planning to rewrite this profile from scratch)
  21. Yepp, that article was my first encounter with PW as well.
  22. Ticket sale for Beyond Tellerrand Berlin (Nov 3-5, 2014) just started - let's try this mini ProcessWire meetup again!
  23. Hi schlagi, no bug But you have to activate these particular URL segments on the template first. See screenshot:
  24. Count me in, too
  25. PHPStorm, and before that Sublime Text 3
×
×
  • Create New...