I’m trying to set up my first project with Kirby using Webflow as a starting point for the basic html/css structure. I’m a designer and completely new to PHP, so forgive me…
I’ve been following along parts of the tutorial video "Kirby 3: How to build a website from scratch“ and have managed to structure my content and build basic templates with snippets, but:
I’m confused about how to use snippets properly, fe I have a page wrapper around everything (set to relative) to stick my footer to the bottom (absolute), but now the opening tag is in the navigation, the closing tag in the footer. And this probably isn’t how it works, right? (screenshots below)
I’ve trouble setting up the projects list or better, I get the list to show, but somehow it makes my footer shift to left. Any ideas where I could search for the problem?
And generally: I’m determined to get into it (PHP book on the way), and of course I’m reading the docs etc., but I miss some more examples or maybe best practices. Any recommendations where to look for those? Is the Starterkit somewhere up and running btw, so I could have a look at the code there and try to learn from there?
Footer with everything shifted left, works when ul isn’t in there.
And the code:
for some reason the system won’t let me put it here…
PS to 3. okay, I think I got it now: I didn’t know so far how to run different projects in MAMP…
Now I know…
Hey @neongrau, welcome to our forum!
We have seen a lot of non-devs here becoming very proficient Kirby devs, so please don’t feel put off. At the beginning, the learning curve might be a bit steep, but we are always here to help.
I haven’t really been able to follow the discussion, so not sure where to best hook in.
As regards snippets, I don’t really agree that their only purpose is to have reusable components. It often helps to move stuff to snippets to create easier to handle chunks of code. The header and footer in the Starterkit are good examples of code that is not self-contained.
Don’t hesitate to ask your questions anytime you get stuck.
thanks for the welcome!
So far, my main questions aren’t solved yet, I’ll try to say it differently again:
Snippets: my main problem here was that, in order to make my footer stick to the bottom of the page all the time (even if the content isn’t enough to push it down), I used a page wrapper (set to relative and min height 100vh) to be able to set the footer to absolute. But when I now divide my code into snippets, the opening and ending tags of that wrapper would, as far as I understand it now, be in different snippets. That doesn’t seem a good solution to me, right? So, is there a workaround/best practice or just another good way to make my footer stick to the bottom?
And the 2. question is actually still at the same level as in the original post. If you have another idea why this happens, please let me know. Webflow has some basic structures and CSS that comes with it, but since the php goes into it’s own section, I don’t understand how it can possibly affect the footer? Any ideas?
And are my questions more clear now?
It depends. Since the opening body tag is usually in the header and the closing body tag in the footer, an additional opening and closing tag right after the opening body / before the closing body tag for a page wrapper in header and footer would be ok, I think. And personally, I do it this way. Apart from in the header and footer, however, I’d try to avoid separating opening and closing tags, and maybe only move the inner stuff into a snippet.
Not really, at least not without looking at the code/styles. I’ll give you more rights, so that you can post code here. Or is the site already online somewhere?
If it’s good enough for you, it’s certainly good enough for me
I just wanted to learn it right from the beginning, because once you have established routines…
Not yet, but I’ll post the code: only the projects.php or also the css files? (sorry it took me so long to answer, I actually tried to upload the project, but I’m having FTP issues…)
Since this seems to be a styles issue rather than an HTML thing, it would be good to have both the HTML and the CSS.
If you want, you can upload the zipped files somewhere and send me a PM
Already on it It was way to much css… I’ll put it in Dropbox and send you the share-link, okay? And btw I’m not in a hurry, you don’t have to work in the evening for me now…