-
Posts
516 -
Joined
-
Last visited
Everything posted by louisstephens
-
Hey Roland_Juno, when you click on the ">" next to Move you should get the following options: However, if the page is locked, it should have a lock icon next to it.
-
That is strange, <?php echo $page->template->name; ?> seems to work for me. Did you try using "echo" in yours?
-
How do I edit multiple pages at once, based on a WHERE criteria?
louisstephens replied to desbest's topic in Getting Started
Thanks @kongondo, I have updated my response to reflect your revision. I knew I missed something. -
How do I edit multiple pages at once, based on a WHERE criteria?
louisstephens replied to desbest's topic in Getting Started
<?php $a = $pages->find("template=yourtemplatename, fieldname=search_criteria"); foreach ($a as $b) { $b->title = "New Name Here"; $b->save('fieldname); } ?> Its untested, but this should do the trick (for updating a title). However, someone please chime in if I have missed something. -
Hey desbest, what version of processwire are you currently using? If you are using 3.x.x, you will probably need to incorporate <?php namespace ProcessWire; ?> into your template files. However, there might be a few other things needed as this profile was introduced 5 years ago and has been removed from the Site Profiles currently in the modules directory. There is though an updated version by @dadish that updates it to v3.x.x, and it can be found here.
-
Welcome to the forums and to processwire @Eljeff! Currently, processwire does not have ready made templates to drop in, or a marketplace for such things. However, when you install a fresh copy of processwire, you get several site profiles to use, and there is a bootstrap profile out there. One of my favorite things of processwire, is that is is very simple to get a basic site up and running. With just a few if/foreach loops and echo's, you can get a simple site going very quickly. This makes it super easy to integrate your own framework/css into the mix. @flydev has shared these videos which will help out in the start of your templating:
-
You could create another field (ie seo_title) and then in the meta title (for that page) use: <title><?php echo $page->seo_title; ?></title> or really echo that in whatever tag you need.
-
I have been looking up everything I can to try to find what's going wrong with this. I have a very simple form (title and file field set to multiple) that will create a new page with the name and attachments. However, it appears that I am missing something crucial as only 1 item gets uploaded to the field. Here is my code: <?php $uploadpage = new Page(); $uploadpage->template = "dashboard"; $uploadpage->parent = $pages->get("/testing/"); $uploadpage->title = $sanitizer->text($input->post->new_title); $uploadpage->save(); $uploadpage->setOutputFormatting(false); $u = new WireUpload('test_upload'); $u->setMaxFiles(6); $u->setOverwrite(false); $u->setDestinationPath($uploadpage->test_upload->path()); $u->setValidExtensions(array('jpg', 'jpeg', 'gif', 'png', 'pdf')); foreach($u->execute() as $filename) { $uploadpage->test_upload->add($filename); } $uploadpage->save(); ?> I have the max files set to 6, and have a foreach loop to add the files, but it is only uploading one. Does anyone see where I might have gone astray?
-
I actually have done something similar on a project using the Date/Time, and at the time, a checkbox. However, I have since moved it to 2 Date/Time fields. I simply compared the two, and used an if statement to display the page content if the condition was met. This is rough, but it is similar to what I have done: <?php $startdate = $page->start_date; $expirationdate = $page->expiration_date; //you will probably need to use strtotime on these to compare. if ($startdate < $expirationdate) { //show the desired information } else ( echo "We're sorry, there are currently no promotions availabe."; ) ?> However, I guess this might not suite your needs since the page will still be visible, unless you do some checking in your navigation to show/hide the url with a conditional.
- 4 replies
-
- crone job
- process wire
-
(and 1 more)
Tagged with:
-
Where will I find more themes/templates for ProcessWire?
louisstephens replied to davede's topic in Themes and Profiles
Welcome to processwire davede. Unfortunately, there currently is not a marketplace or library of themes available for pw. That being said, when installing a fresh install of pw, you do get several site profiles where you can dig around in the code. I do believe there is a uikit and bootstrap (4) site profile floating around here as well. One of my favorite things about pw is with just a few if/foreach loops and echo's, you can get a simple site going very quickly. This makes it super easy to integrate your own framework/css into the mix. This actually isnt a bad read through (in regards to making a simple "theme"): https://webdesign.tutsplus.com/tutorials/how-to-develop-a-processwire-theme--cms-25692 -
Frontend editing and content creation possibilities?
louisstephens replied to Enrico's topic in Getting Started
As far as I know, there is not a way for a user to create new pages strictly via a front end instance (without using the api). However, you could use the backend and allow a user to create a page (and not allow publishing), or you could create a form on the front end (After login) that would allow a user to fill it out and create a page utilizing the API. -
[solved] Count # of PDFs in field and echo
louisstephens replied to louisstephens's topic in API & Templates
Yep, I completely forgot about using wire('page') in the _func.php . That did the trick. Thank you abdus. -
So maybe has already figured this out, but I am stumped. I have a field (test_field) that is set to pdfs, and I was trying to get a count of the number of pdfs in that field so I could add it to a status bubble on the front end. I tried: function testPDF() { $a = $page->test_field->count(); echo "<span class=\"bubble\">" . $a . "</span>"; } but it is returning "NULL" . I currently have 3 added to the field. I also tried putting this function in _func.php, though I need to use wire('pages'), but I only need to get the count for that specific page, so I am sort of at a loss of how to proceed.
-
Fbg13 is right, in that you will need a working knowledge of php. However, my knowledge of php is not up to par (to some of the members here), but I am still able to code out a lot of "complex" pages. It can be as simple as getting the page title/body (very basic example. <h1><?php echo $page->title; ?></h1> <p><?php echo $page->body; ?></p> I guess what I am saying is not to get too discouraged. A simple site (with a bit of knowledge in php) can be made quite quickly. I have learned more than ever with just doing and various other forums. Also, the forums here are great to search through to find answers to your questions. Looking back, I have asked some pretty "silly" questions that now I can tackle no problem.
-
It is very strange, on my 3.0.61 dev/testing site, I do have the repeaters showing up in the template select. I created a test_repeater for this, and as You can see, it is displaying at the bottom of the list in my screenshot. I have $config->advanced = false; (what Ryan was asking in the github issue), and to be honest I am pretty confused as to why this is showing up. Does anyone else have this occurring in a dev setup or a live? Note: test_repeater has 5 items added to it (used on 1 template, but the specials repeat has 4 items , but is being used on multiple pages (I guess where the duplication comes from).
-
Im still trying to see if I can duplicate your issue on my end, but I do see that an issue was created in June regarding the same thing: https://github.com/processwire/processwire-issues/issues/287 However, it does not seem like Ryan could duplicate it either. Ill keep testing, though hopefully someone else will have an actual answer for you.
-
[solved] Uikit 3 Grid Not Working as expected (or is it)
louisstephens replied to louisstephens's topic in Dev Talk
Thanks @AndZyk! That indeed solved the image issues. On your point regarding the logo, serving a compact logo for mobile is what I hope to accomplish in the long road. I also noticed that changing the column to uk-width-1-1@m helped with the resizing on mobile as well (in terms of the column). I appreciate all the help.- 4 replies
-
- 1
-
-
- frameworks
- css
-
(and 1 more)
Tagged with:
-
Perhaps someone can help me on this. I recently started poking around at uikit (I have used bootstrap and foundation previously) as I liked the admin theme and a few of the components. However, their documentation is a bit confusing and I can never get the desired results. I am sure I am doing something wrong, but I did not want to digg into v2, if things will be changing (for better or worse). I have the following: <div class="uk-section"> <div class="uk-container uk-container-large"> <div class="uk-child-width-1-1@s uk-grid-small uk-grid-match" uk-grid> <div class="uk-width-1-2"> <img src="images/logo.png" alt="" width="1183" height="167" /> </div> </div> </div> </div> <div class="uk-section"> <div class="uk-container uk-container-large"> <h3>Section</h3> <div class="uk-child-width-1-4@m uk-grid-small uk-grid-match" uk-grid> <div class="item"> <div class="uk-card uk-card-default uk-card-body"> <h3 class="uk-card-title">Default</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> </div> <div class="item"> <div class="uk-card uk-card-default uk-card-body"> <h3 class="uk-card-title">Primary</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> </div> <div class="item"> <div class="uk-card uk-card-default uk-card-body"> <h3 class="uk-card-title">Secondary</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> </div> <div class="item"> <div class="uk-card uk-card-default uk-card-body"> <h3 class="uk-card-title">Secondary</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> </div> </div> </div> </div> The cards at the bottom stack on mobile which is the desired effect. However, the logo at the top is squished and on mobile does not seem to be resizing to take on the .uk-child-width-1-1@s. Is there a way to prevent the logo from squishing, and for it to resize with the browser? I have noticed when I do <div class="uk-section"> <div class="uk-container uk-container-large"> <div class="uk-child-width-1-1@s uk-grid-small uk-grid-match" uk-grid> <div class="uk-width-1-2"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> <div class="uk-width-1-2"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> </div> </div> </div> that the grid also does not collapse to full width either. I am positive I have just missed something in the documentation, or how uikit is supposed to work. However, for the life of me I can not find it.
- 4 replies
-
- frameworks
- css
-
(and 1 more)
Tagged with:
-
Thanks everyone for the help. I got a bit turned around and was struggling with digitalocean, when I should have been interacting with runcloud as my "dashboard". Ill let everyone know how my setup turns out once I get to it this morning.
-
I was going to start working on a new site for myself and wife (a new hobby we have taken up), and had decided to try out Runcloud and Digital Ocean. I got my drop set up on digital ocean, as well as setting up various hooks/databases etc between github and run cloud. However, now I have hit a wall. I cloned my "blank" repository into my local host (managed through MAMP) and dropped in a fresh install of PW, but now I have no idea of how to move forward. Is it best to just work locally, and then push this into a branch, and when ready, change branches and commit all to run cloud? Run cloud gives me an IP address to use for the database, but I can't get my localhost setup to recognize (I just get "Connection refused"). I am also unsure how to actually get my commits to push to run cloud, and handling the new set up. I am probably in over my head, but I thought I would try something new as a good learning experience. However, now I am just drowning . Hopefully someone has some ideas on how to approach this, as I am very eager to get under way.
-
Maybe he means in 2 different browsers? I know sometimes I have a dev site open in chrome and opera so I can be on two different pages in the admin.
-
I have not tested this, but a few others have gotten it to work. Hopefully this gets you going in the right direction, or hopefully will respond with a better approach. Also, I think you have duplicated your post in the forums.
-
I think a comprehensive doc would help greatly with new users or people on the fence. I know this has been discussed to death, but one place for the api/cheatsheet/tutorials with snippets/starting points would give first time users a confidence boost. I feel like I spend hours (if my project is large) googling and jumping between the references. It can be a bit disheartening at time. With all that being said, it doesn't seem to be "as bad" as when I was first starting out as I now have a better grasp on functions/the flow of PW. I have started moving away from granting access to the backend for in house projects, and instead, building "backends" on top of PW for them to use. I found it easier to give them only what they need to see than to have them getting scared of the page tree. I understand that PW is pretty much open ended and is only limited by your imagination, but maybe (dare I say) a template with the barebones for a dashboard/backend (perhaps with some ajax) built on top of PW could be helpful as well for new users. I know I still struggle with working ajax into projects and making something flashy, and examples always help (like live page listing refreshes etc). Understandably, this couldn't be a one size fits all, but it would be a great jumping off point for the newly initiated and make it more comfortable when granting access to the client or whomever the project is intended (Only intended if that workflow suites the project I know). The backend isn't such a scary place, but to whomever doesn't need all of the tree, could be nice. Well, I will end my ramblings, but thought I would throw my 2 cents out there.
-
Under the "Input" tab for the field (in question), you can set the max width and/or max height for uploaded images. However, if you are trying to output a max-width property for use with your hanna code, My "solution" might not be what you are looking for.
-
@Chris Falkenstein, There is also the "Auto Grow" plugin for ckeditor. Simply download the plugin (and expand/unzip), and put it under : "site->modules->InputfieldCKEditor" . Edit the textarea field in question (make sure ckeditor is selected under details), navigate to the "Input" tab, and select "autogrow" from additional plugins and save. I just tested it out and it seems to work perfectly for me.