-
Posts
357 -
Joined
-
Last visited
-
Days Won
5
Everything posted by qtguru
-
Tip request: users and user-generated content via front-end
qtguru replied to heldercervantes's topic in API & Templates
I wanted to go for the regular user but it didn't make sense for me to do so, as I didn't want to want users in the backend, also as for my solution we already imported the users into pages with password so it was obvious taking the regular route was too late so what i did, was create a login that checks the pages for password. I created a Hook to change the layout to my Admin Backend and i was able to get an admin interface I simply used the Session to store the user id and once its gone it redirects to the login page. Also for the backend i created a Class to parse the Url Segment and call a similar method in a controller e.g url1 is always the controller and url2 is the action and I default to a controller and an action. This works well for me as an AVID MVC adopter so its hard for me to change my pattern which is why i like PW it allows me create a flexible system. -
Only 3 Artists i play while coding 1. Enya 2. Marina and the Diamonds 3. Kendrick Lamar
-
UPDATE: So after trying to created a backend administrator page I encountered an error , It rendered the template twice apparently it seems my code was the cause of it so i have changed everything to something more cleaner and simple. public function init() { $this->addHookBefore('PageRender::renderPage', $this, 'boot'); } public function boot($e) { $pages = wire('page'); if ($pages->name === "member-dashboard" && $pages->isPublic()) { $TemplateObject = $e->config; $TemplateObject->appendTemplateFile="_admin.php"; } else { if($pages->template->name !== "admin"){ $TemplateObject = $e->config; $TemplateObject->appendTemplateFile="_main.php"; } }
- 75 replies
-
Seriously guys why don't i know about this ? now this will make things a lot more better
-
How to use wordpress template for processwire?
qtguru replied to goldenghost07's topic in General Support
It would be very difficult, PW has no concept of template, its data-driven its up to render the data to the HTML, however if you know Wordpress function simply take out those calls but my advice is to save the whole page as HTML, I tried using a WP template to PW but sadly WP is poorly coded some template parts can be in a function and would take years finding.- 7 replies
-
- processwire
- wordpress
-
(and 1 more)
Tagged with:
-
@Nico I didn't use the User from Processwire as I don't want user having knowledge of the backend the users are stored in a page which contains their details and information but i have implemented it in a way which makes better sense to me in terms of flexibility its on my topic "How to do this feat in processwire" @GuruMeditation I got my eyes on EasyiiCMs and its even on Yii2 I will clone and contirbute to it once i upgrade my Yii knowledge
-
This was how i achieved having different layouts for my pages without touching the _main.php Enjoy public function init() { $this->addHookBefore('TemplateFile::render', $this, 'boot'); } public function boot($e) { $pages = wire('page'); if ($pages->name === "member-dashboard" && $pages->isPublic()) { $TemplateObject = $e->object; $TemplateObject->setAppendFilename(dirname(dirname(dirname(__FILE__))) . "/templates/_admin.php"); } else { if($pages->template->name !== "admin"): $TemplateObject = $e->object; $TemplateObject->setAppendFilename(dirname(dirname(dirname(__FILE__))) . "/templates/_main.php"); endif; } }
- 75 replies
-
Questions about ProcessWire for building a Magazine
qtguru replied to elmago79's topic in Getting Started
Oh my God, our former application in Wordpress still gives me nightmares pending we move to PW, with PW i am quite comfortable things will be alright as the API is just so easy its why am eager to contribute to 3.0 to make it superb. -
Questions about ProcessWire for building a Magazine
qtguru replied to elmago79's topic in Getting Started
At OP, take my experience i came to PW with the experience of Wordpress, Zend , Yii Framework , ASP.NET MVC and the biggest advice you will get from me is almost the same as above "Just unlearn the illogical (Only Wordpress is illogical) pattern of other systems and take the most simple route." and also Template,Hooks and Module and wireData are the only thing you should really focus on to understand PW. -
Oh trust me i have a detailed list of things that should be in a tutorial can you give me this week to collate them. Week days are hectic for me.
-
UPDATE: So After proper research and couple of beers and some Skyrim gaming, I realized that the previous solution stated was not appropriate, so i took a better approach. 1. I created a module hooking into Template::render 2. then i get the Session using the wire method 3. I also get the pages using the wire method then i check if the page url is member-login and when session has been enabled 4. if so i get the template from the event and i call the setAppendFIleName to my specified layout if not 5. set the main one However this also affects the admin page so i ensure that the page is not an admin if it's an admin do not set the main layout, so it seems i underestimated the Hook functionality as this is way intuitive then messing around the _main.php
- 75 replies
-
I just woke up this morning and that thought crossed my mind while not create a hook to page to render the admin if the page url is member-dashboard but i put that logic in the member-login instead and it works, i guess my issue is am still stuck with the concept of other Framework's way of doing things. Thanks for the response.
- 75 replies
-
- 1
-
Yeap so what's the next step ?
-
Yeah its not really open source i know there's a free version I know of another Ciims but still WIP, i like PW but doing somethings here are a bit different for me, like Changing layouts when a user is logged in tried using Hook but apparently there's no way to dynamically change the config before a page is rendered.
-
if i could see a killer CMS with Yii Framework it would be awesome
-
Okay got another task I have an admin dashboard created however I want when a user logs in i totally change to a different layout. is it possible to Hook into PW and change the template from _main.php to another ? Thanks
- 75 replies
-
http://www.codersgrid.com/2013/07/15/daux-io-documentation-generator-using-markdown/ This is something we should look at it uses markdown and it could leverage on Github meaning the snippets could be updated via Github just like processwire recipe, its highly depressing switching from looking at source code to scanning forums for answers. and if not some of the community can take it in our hands to create a separate site for documentation just like the processwire recipe. P.S it would be better if documentation were contributed by us, that way the Processwire Dev team can work on the updates of Processwire rather than being bothered about documentation.
-
could a ajax submit call directly to a php script ?
qtguru replied to adrianmak's topic in General Support
THe only i can think of Ajax working in a sane manner is to have a page handle Ajax codes and from that page dispatch external Class function depending on the Ajax request. seriously can't wait for PW to have a View like, my project is littered with templates -
Yeah in terms of request this is not a big priority. alot of things in the Pipeline also out of curiosity is it possible to Contribute codes to Processwire, I think it'd be much easier and relieve Ryan a lot of stress.
- 16 replies
-
- graph databases
- database
-
(and 2 more)
Tagged with:
-
I think the Analogy is wrong, Go is a concurrent language which is nothing compared to PHP, however I don't see the need for SQLite but that's my opinion, so prob a database wrapper to allow others write their own drivers or their various databases. something in the line of PDO
- 16 replies
-
- graph databases
- database
-
(and 2 more)
Tagged with:
-
Same here i'm facing the same issue and its quite limiting am going to extend the Form and add a tight coupling with Valitron and override processinputfields not really a fan of PW's Form Handling it has only required. Oops after re-evaluation not worth it this is the best way to go about it
-
@teppo i get what you mean, am more thinking for in the long run things we should look at against 3.0 not immediate changes, also is there a forum where 3.0 discussion takes place i'd be interested in keeping up with updates and see if there's any code contribution needed.
-
Today got to deal with the part i hate the most (Form Handling) because there are so much scenarios in Forms, Form handling with Wordpress sucks so bad, however in Processwire its somehow limiting however it gives room for expanding so i had an idea. There's no way I would like to create my own validation library so I decided to extend the InputFieldForm to allow some methods 1. setValidator,getValidator 2. setError/getError //already provided 3.get/set Field //already provided My plan was to override the processInput to trigger the validator for each field and send the error to the respective field which will be pulled in a template. using form in the frontend is just too limiting and haven't seen a way to also have control over my markup, any documentation to assist
- 75 replies
-
I know alot of people won't be pleased to hear this but Hari is right, Standardization is very important, that way framework interoperability can be a reality, its not fun for a dev to switch different programming practice, a good example is the Symfony Components which is easily used in other Projects, an example of such project is the MonoLogger. That way we can leverage on exisiting libraries and boost Processwire rather than building everything from scratch. however these are my personal opinions.
-
Three new responsive Processwire sites for animation/vfx group
qtguru replied to Crawford Tait's topic in Showcase
wow Guild of Wars looks awesome. nice site do they post about MMOPRGS on that sites ?