Peter Knight
Members-
Posts
1,377 -
Joined
-
Last visited
-
Days Won
5
Everything posted by Peter Knight
-
Had a discussion with a developer friend this morning about hacking (preventing) and backing up sites and databases. Here's some of the methods disussed: PHP scripts hooking into DropBox/Amazon/Google Drive Manually backing up and saving to NAS. Manually backing up, syncing to NAS and then syncing to online service Writing CRON jobs which scan the root for file and folder changes, email you alerts and backup at regular intervals. Online services such as CodeGuard What method(s) do you use to backup your sites. I'm talking about any type of site on any CMS.
-
Good advice. I was using a PageSelect because in the future I'll have 3 different types of posts all generated from the blogging module. And thanks for the code samples and explanations too. I've had a bit of a rethink about this. If I'm not using 90% of the Blogs features (Categories, Comments, Athors) etc then I may be better off disconnecting my special posts from the blog. Otherwise I'm trying to adapt and rewire the Blog when it's perfectly suited to it's task and should probably be left alone. Sorry about the back tracking. Appreciate the examples though.
-
I've added a field called Content_Type to the Blog Post template. I tag *some* posts with as Content_Type=Studio Watch to differentiate them from "regular" bog posts. There's nothing special about these pages. I simply use the Blog as a central publishing platform but pages marked Content_Type=Studio Watch are special and pulled onto a stand alone section of the site. Here's how the field looks in the Blog_Post template. Is there a way on the Blog Posts page (front end) to filter out any posts marked with this tag/category. OR Maybe I'm trying to do something here which will get me in knots. These particular pages shouldn't be listed in the front end under Posts, Categories, Tags, Comments, Authors or Archives. Hmmm, perhaps I need to not use the blog for this particular task. What do you think?
-
Best approach: Repeatable fields Vs separate PW pages
Peter Knight replied to Peter Knight's topic in Getting Started
@Sinnut - Your last suggestion worked out very well. I'm still using the Blog to create most news items of various types. I have a new field called "Post Type" from which I can categorise a post as a "Studio Update". The only issue I had was that my Studio Update tags were appearing in my general Blog tags. I just created a seperate tagging system for Studio Updates. Thanks for the advice. -
Check out ico moon. Actually, there are lots of great icon sets out there.
-
There are usually 2 menu types on most sites. Let me generalise here a bit. You've got the top navigation which tends to be global. It's on every page and usually accompanies the company logo. Then you've got the side navigation which is contextual or based on the section the user is currently within. I'm assuming you're asking how you your client can pick which links / pages are used on the top navigation? Create a field called top_navigation or something meaningful to you and your clients Set it to Type=Page type (Basics Tab) Make it Multiple Pages (Details Tab) Assign it PageListMultipleSelect+ win the Input field type (Input tab) Finally, associate this naviagtion field with a template. You can just assign it to the homepage or you could create a new page called Site Settings or Navigation. Just tell your client this is the place to manage their top menu. Here's a screengrab of how it should look.
- 75 replies
-
- 8
-
So true. Thanks horst. Pia is one fine lady.
-
Horst - I solved it by removing my crop image and starting again. Ok, it didn't really solve the problem but I needed to work on those pages.
-
Suddenly getting an error on any pages using CropImage This is in the admin and not the front end of the site. I never had a CropImage called "thumb" so I assume some of the error message is missing? You'll notice too how the page fields fail to load. After the page title, I had several fields and 2 image fields with CropImage settings. I hadn't edited a CI setting or removed any in between the time the pages/images were working and when they stopped. Is there somewhere in the database, I can find more detail of whats wrong?
-
That's my general lack of PHP experience shining through. Out of interest, what way would you improve this? It's as simple / manageble as possible but I'd be very keen to see another interpretation and see how I am over complicating this. Before I started to integrate the field content into this, this is the default code <section> <div class="cd-timeline-block"> <div class="cd-timeline-img"> <img src="img/cd-icon-picture.svg" alt="Picture"> </div> <!-- cd-timeline-img --> <div class="cd-timeline-content"> <h2>Title of section 1</h2> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum aut hic quasi placeat iure tempora laudantium ipsa ad debitis unde? Iste voluptatibus minus veritatis qui ut.</p> <a href="#0" class="cd-read-more">Read more</a> <span class="cd-date">Jan 14</span> </div> <!-- cd-timeline-content --> </div> <!-- cd-timeline-block --> <div class="cd-timeline-block"> <!-- ... --> </div> </section> Here's the tutorial I've taken from http://codyhouse.co/gem/vertical-timeline/
-
Thanks guys. Appreciate the advice. Will try these tomorrow. #WorkingAtWeekend
-
I have this crazy long php script and the 8th line down references an image. I'm trying to call an image which is not associated with the page or any pages. It's just sitting on a folder. If this wasn't called within PHP code, Im supposed to do something like this: <img src="<?php echo $config->urls->site; ?>assets/images/IcoMoon/Icons/SVG/globe.svg" class="logo"> But that doesn't work and am wondering what best practice is in this scenario? <?php $updates = $pages->find("template=blog-post, blog_tags=Studio Watch, ");//Get blog posts tagged Studio Watch echo"<section id=\"cd-timeline\" class=\"cd-container\">"; foreach ($updates as $update){ $customdate= date("F Y", $update->getUnformatted("blog_date")); echo" <div class=\"cd-timeline-block\"> <div class=\"cd-timeline-img\"> <img src=\"/assets/images/IcoMoon/Icons/SVG/globe.svg\" alt=\"Picture\"> </div> <div class=\"cd-timeline-content\"> <p>{$update->title}</p> <div class=\"mini-tag\">"; { // Tags for client location echo "<i class=\"fa fa-globe\"></i>"; foreach ($update->client_location as $geo) {echo "{$geo->title}";} } echo"</div>"; // Tags for general tags echo"<div class=\"mini-tag\">"; { echo "<i class=\"fa fa-tags\"></i>"; foreach ($update->blog_tags as $tags) {echo "{$tags->title},";} echo"</div>"; } echo"<span class=\"cd-date\">{$customdate}</span> </div> </div>";} echo"</section>"; ?>
-
Will Brackets and Atom give Sublime serious competition?
Peter Knight replied to Joss's topic in Dev Talk
Brackets looks interesting. Having downloaded it and tried it for a few mins, it certainly has my attention. Not sure how useful the Extract engine really is but thats an optional add on. Only reason I'd put the brakes on using Brackets as part of my tool kits is I feel I'm already overly invested/reliant on Adobe products. I use the Creative Suite platform and while overall, I think it's good value I don't necessarily trust them not to keep raising prices (Irish customers are already overcharged) and they have a habit of randomly culling products. Take Fireworks for example. -
Will Brackets and Atom give Sublime serious competition?
Peter Knight replied to Joss's topic in Dev Talk
One of the holds which Dreamweaver has on my worflow is the FTP element and the fact that it holds all my SiteProfiles. If you're using ST and developing remotely, what are you using for FTP? -
Thanks Martijn That's pretty cool. I can kind of make out whats happening there. Love the ampersand at the end too.
-
I'm actually redoing my own site Joss
-
I have two sets of tags and I'm manually adding a comma after the echo which works but adds a comma to the very last tag too. {echo "<i class=\"fa fa-globe\"></i>"; foreach ($update->client_location as $geo) {echo "{$geo->title},";} {echo "<i class=\"fa fa-tags\"></i>"; foreach ($update->blog_tags as $tags) {echo "{$tags->title},";} You can see in the above screen grab that this works but adds a comma to the last word too. It's not a huge deal but I'd prefer the last word not to have a comma. I think it's called "implode" in PHP when you take an array and automagically separate each value with a comma? Would I end up with exactly the same issue by using an implode function?
-
I guess I'm planning on changing the output format depending on the template. Therefore, starting off with the most detailed info and whittling it down to just Month Year would be best so I'll run with something like this $customdate= date("M Y", $update->getUnformatted("blog_date")); Cheers Joss. Cheers @Kongondo. Looks like we posted at the same time again
-
The published field of a page is: {$update->blog_date} and outputs as 8 March 2013 12:00 am If I want to change the Date Format to March 2013, is it advisable to change this via PHP or directly via the field settings. I notice I can specify the Date/Time Output Format Code via the field the Details and Input tabs but I'd rather not mess around with the source info. I'm guessing I've to create a variable based on the published date and then use some filter to specify M, YYYY. Just looking for a point in the correct direction. Thanks.
-
Selector problem - output only tag titles
Peter Knight replied to Peter Knight's topic in Getting Started
Ok, finally fixed it. I realised the second foreach loop needed to be way down the code. Once I figured out my list of brackets, semi-colons, quotation marks etc etc it worked Here's my code <?php $updates = $pages->find("template=blog-post, blog_tags=Studio Watch");//Get blog posts tagged Studio Watch echo"<section id=\"cd-timeline\" class=\"cd-container\">"; foreach ($updates as $update) { echo"<div class=\"cd-timeline-block\"> <div class=\"cd-timeline-img\"> <img src=\"img/cd-icon-picture.svg\" alt=\"Picture\"> </div> <div class=\"cd-timeline-content\"> <p>{$update->title}</p>";{ echo "<i class=\"fa fa-tags\"></i>"; foreach ($update->blog_tags as $t) { echo "{$t->title}"; } echo"<span class=\"cd-date\">Jan 14</span></div></div>" ;} } echo"</section>"; ?> -
Selector problem - output only tag titles
Peter Knight replied to Peter Knight's topic in Getting Started
Ok, closer to completion. I'm now not getting any duplicates after adjusting the nesting. Still only getting 1 tag on the Project Tag and Location Tag even though there should be two or three. <?php $updates = $pages->find("template=blog-post, blog_tags=Studio Watch");//Get blog posts tagged Studio Watch echo"<section id=\"cd-timeline\" class=\"cd-container\">"; foreach ($updates as $update) foreach ($update->client_location as $location_tag) ; foreach ($update->blog_tags as $project_tag) { echo"<div class=\"cd-timeline-block\"> <div class=\"cd-timeline-img\"> <img src=\"img/cd-icon-picture.svg\" alt=\"Picture\"> </div> <div class=\"cd-timeline-content\"> <p>{$update->title}</p> <strong>Tags:</strong>{$project_tag->title} <strong>Location:</strong>{$location_tag->title} <span class=\"cd-date\">Jan 14</span> </div> </div>"; } echo"</section>"; ?> -
Selector problem - output only tag titles
Peter Knight replied to Peter Knight's topic in Getting Started
Hmm, this is interesting. Im not sure again if my syntax is correct or nested badly but I'm only getting a single tag from each post and the page is outputting as follows Title of Post 1 Tags: Tag 1 Title of Post 2 Tags: Tag 1 Title of Post 2 (again) Tags: Tag 1 Title of Post 3 (again) Tags: Tag 1 Title of Post 3 (again) Tags: Tag 1 Title of Post 3 (again) Tags: Tag 1 <?php $updates = $pages->find("template=blog-post, blog_tags=Studio Watch");//Get blog posts tagged Studio Watch echo"<section id=\"cd-timeline\" class=\"cd-container\">"; foreach ($updates as $update) { foreach ($update->blog_tags as $project_tag) { echo"<div class=\"cd-timeline-block\"> <div class=\"cd-timeline-img\"> <img src=\"img/cd-icon-picture.svg\" alt=\"Picture\"> </div> <div class=\"cd-timeline-content\"> <p>{$update->title}</p> Tags:{$project_tag->title} <span class=\"cd-date\">Jan 14</span> </div> </div>"; } } echo"</section>"; ?> -
Selector problem - output only tag titles
Peter Knight replied to Peter Knight's topic in Getting Started
@Kongondo - Basically I'm using your blog system with some tweaks. I have *some* posts tagged as "studio watch" which are not so much full blog posts but mini updates consisting of A headline (which is blog title) Project Tags (which are the normal tags which come boxed with your blog Module) Location Tags (very similar to normal tags but a seperate parent folder for the pages created as tags). (Haven't got round to this bit yet) I'm then using a CSS Timeline I found and tweaking it to make it pull in the above. -
Selector problem - output only tag titles
Peter Knight replied to Peter Knight's topic in Getting Started
Thank you Kongondo. Thats exactly what I was looking for and I don't mind the duplicates right now. You seem to be nesting foreach statements there? Haven't seen that before but I guess it makes sense. I drastically simplied the first code example for the sake of outputting *something*. What I'd like to do is apply your code to my code example. Let me see if I can figure this out. Time to put kettle on and switch off the phone <?php echo"<section id=\"cd-timeline\" class=\"cd-container\">"; $updates = $pages->find("template=blog-post, blog_tags=Studio Watch");//Get blog posts tagged Studio Watch foreach ($updates as $update) { echo"<div class=\"cd-timeline-block\"> <div class=\"cd-timeline-img\"> <img src=\"img/cd-icon-picture.svg\" alt=\"Picture\"> </div> <div class=\"cd-timeline-content\"> <h2>Title of section 1</h2> <p>{$update->title}</p> <a href=\"#\" class=\"cd-read-more\">Read more</a> <span class=\"cd-date\">Jan 14</span> </div> </div>";} echo"</div>"; echo"</section>"; ?> -
Selector problem - output only tag titles
Peter Knight replied to Peter Knight's topic in Getting Started
My template is blog-post. Have edited above. @Joss That gives me the same result as my original PHP. IE echoes the titles of the tags AND the titles of the pages containing those tags. Is there another way to do this so I am only outputting tag titles within pages based on that template.