The Word Body

The word Body stressed me out for 3 whole weeks....

So Its fair to say i'm pretty new to the world of coding, The first bit of coding work i done was about a year ago for the company i work for. i'm loving my journey so far, and as a little challenge to myself i thought id build myself a blog site.

My Work Flow

Installing TailwindCSS couldn't be any easier these days, just follow the instructions over at Tailwind Installation Guide and choose your framework.

Laravel Wink

stumbled across this package by accident when looking for some sort of CMS package for Laravel.

the installation for this package couldn't be any easier... its designed to give you the bank end for the blogging platform but then the front end display is all up to you!

This installation guide can be found here: Laravel Wink GitHub Repo and installation guide.

Building the front end

Now i must confess i used a lot of the stuff learnt from the Laracasts: Build a Video Game Aggregator Series... if your new to Laravel this is a great start to finish project to learn (Also see the Laravel from Scratch series).

i used the styling from that and some bits i found online and came up with a front end i was happy with, and on the surface it looked like passing information to the front end from the Wink controllers would be a piece of cake and in most part they were.

But when i used the following code, all of the P tags int he code were displayed in the front end and i couldn't change that at all i searched high and low and found a few different variations using custom Tailwind Components to add into the main tailwind but all of this was too complicated and honest.... i didn't have a clue on how to implement most of it.

i was looking at it and thinking "it should work!" but it didn't, here was my code for that section of my site..

<div class="pt-4 border-gray-200 mt-4border-t sm:w-3/4 sm:pl-8 sm:py-8 sm:border-l sm:border-t-0 sm:mt-0"> {!! $post->body !!} </div>

i tried using the rich text editor and the markdown i tried wrapping the PHP Array in {!! $post->body !!} format which didn't display markdown properly. after a few hours i got fed up committed what i had to GitHub and tried again the day after... and the day after that..... and so on and so forth for about two and a half weeks.

It was time to beg for help

now i've not had dealings with community stuff before and wasn't holding out much hope of getting any help at all until i stumbled on another blog from a guy called Timothy Addison you can check out his blog Here. I don't even know how i found his blog but when i did i reached out.

now you have to understand i wasn't expecting anything back so i was mega surprised when two hours later i got a response from him. we shared a few emails and he mentioned Tailwind Typography which was EXACTLY what i needed... i got it installed and added the plugin as per the docs and added the prose lg:prose-xl to the div class and refreshed my post and....... it didn't work... Timothy was as confused as i was and said;

Nope that should all work fine... i'm not sure what to tell you, have you tried reaching out to Adam Wathan, he might help....

I just chuckled thinking what would a guy who is obviously a VERY busy man bother with helping me out, but thought... what have i got to lose.

so i jumped onto twitter and asked for help from him... again i wasn't expecting anything back so was mega surprised when he replied to me and tagged in a gent called Simon... You can find him on twitter Here.

Simon asked if i could share my repo so he could take a look. I added him as a contributor and went to bed (it was like 11:30 at this point).

I woke up the next morning and saw a notification from Simon saying "i've fixed your issue.... and i waited for some crazy convoluted way i needed to edit my code.... and was surprised and dumfounded that it was a very very small change needed... and here it is... the issue didn't lie with tailwind but with how i was parsing the data from the Wink package... here was the "code change" i need

Before: {!! $post->body !!}

After: {{ $post->content }}

Yep that was it... the tag body parsed all of the HTML through to the front whereas the content parsed the markdown.... and you've just read through the result of that "Code Change".

Now i'm no expert by a country mile, but if you need any help id like to extend a helping hand like everyone else did for me!