1 (edited by foggyflute 2014-02-28 10:09:20)

Topic: [Solved]Working on the snippset that listing specific blocks.

Hi, it maybe silly to ask (or maybe not), but as I'm a front-end dev with close to zero PHP skill (more of a designer with some basic front-end skill - at work I never have the need to touch the code, only design on Photoshop), this is what I encounter when working with Monstra:

I currently working on this site for a friend: http://fionabenjamin.com/ (static html/css based on Bolt bootstrap theme by blacktie.co)
And there's a section here that I don't know how to do (actually there's a lot of other part but if I can figure how to do this one, the rest is less likely a problem): Frequently Asked Questions in the services page.

There is a warp, then a header, yep no problem to convert into monstra's template...

Then there's items here:

    <div id="lg">
        <div class="container">
            <div class="row centered">
                <h4>Frequently Asked Questions</h4>
                <div class="col-lg-4">
                <h4><i class="fa fa-question-circle"></i></h4>
                    <p class="QnA">
                    <b>What kinds of questions can I ask?</b><br>
                    Anything that does not involve asking about minors or death (i.e How/When will I die?).
                    </p>
                </div>
                ... (and many more items like the one above)
            </div><!-- row -->
        </div><!-- container -->
    </div><!-- dg -->

So... according to my knowledge through the tutorial video by monstrathemes and skipping through the documents. I think this will go down as making that code above into a snippset and replace the content of the QnA paragraph with a block, right?


                <div class="col-lg-4">
                <h4><i class="fa fa-question-circle"></i></h4>
                    <p class="QnA">
                         {snippet get="the-block-i-want"} 
                    </p>
                </div>

If I set out to fix the number of block then there's no problem. But what if I want it to be dynamic, each of col-lg-4 divs above into a snippset and have a bigger snippset that get all of them so if there's not 6 but 3 or 9 or 12 QnA blocks, they will all get display without the need to change the snippset code, like how a blog display it own posts? You guy have a blog plugin so I think it very possible (maybe very easy to do), but, that's where I stuck right now.

Something that will generate something like this:

                <div class="col-lg-4">
                <h4><i class="fa fa-question-circle"></i></h4>
                    <p class="QnA">
                         {snippet get="the-first-of-those-blocks-i-want"} 
                    </p>
                </div>
                <div class="col-lg-4">
                <h4><i class="fa fa-question-circle"></i></h4>
                    <p class="QnA">
                         {snippet get="the-second-of-those-blocks-i-want-if-they-have-a-second-one"} 
                    </p>
                </div>
                ...

PS: Also, I also has the 4 item to sell above with 4 variables needed for each of them: special, name, price, paypal code. If I able to get the snippset that read block and extract data from it, like this:

NEW
60<br>Minute<br>Reading
60
xxxxHS87BT8ZS

So I don't have to make four block with just one word inside it for just one item.
But if I have to, it's okay, no problem at all, just focus on my main problem above tongue

Hope this one is not being asked before, or my search skill totally sucks, in that case, I will be very happy to get a link into older topic.

Thanks for reading.

Re: [Solved]Working on the snippset that listing specific blocks.

wow i love it, i mean this questions smile i was looking for answers forever and finally with ideas from sergeyterr we found a way to do it, simple make a plugin...

i need to ask u, this is a base html code which is not gonna repeat:

    <div id="lg">
        <div class="container">
            <div class="row centered">
                <h4>Frequently Asked Questions</h4>
------------------------------------------------------------------------
            </div><!-- row -->
        </div><!-- container -->
    </div><!-- dg -->

and this is wht u want to repeat with different content?:

                <div class="col-lg-4">
                <h4><i class="fa fa-question-circle"></i></h4>
                    <p class="QnA">
                    <b>What kinds of questions can I ask?</b><br>
                    Anything that does not involve asking about minors or death (i.e How/When will I die?).
                    </p>
                </div>

and u need to be able to change 2 items?
1) "What kinds of questions can I ask?"
2) "Anything that does not involve asking about minors or death (i.e How/When will I die?)."

    <div id="lg">
        <div class="container">
            <div class="row centered">
                <h4>Frequently Asked Questions</h4>
                <div class="col-lg-4">
                <h4><i class="fa fa-question-circle"></i></h4>
                    <p class="QnA">
                    <b>What kinds of questions can I ask?11111</b><br>
                    Anything that does not involve asking about minors or death (i.e How/When will I die?).11111
                    </p>
                </div>
                <div class="col-lg-4">
                <h4><i class="fa fa-question-circle"></i></h4>
                    <p class="QnA">
                    <b>What kinds of questions can I ask?22222</b><br>
                    Anything that does not involve asking about minors or death (i.e How/When will I die?).2222
                    </p>
                </div>
                <div class="col-lg-4">
                <h4><i class="fa fa-question-circle"></i></h4>
                    <p class="QnA">
                    <b>What kinds of questions can I ask?333333</b><br>
                    Anything that does not involve asking about minors or death (i.e How/When will I die?).33333
                    </p>
                </div>
                <div class="col-lg-4">
                <h4><i class="fa fa-question-circle"></i></h4>
                    <p class="QnA">
                    <b>What kinds of questions can I ask?444444</b><br>
                    Anything that does not involve asking about minors or death (i.e How/When will I die?).4444
                    </p>
                </div>
            </div><!-- row -->
        </div><!-- container -->
    </div><!-- dg -->

is it corrent? u can see different 1111 2222 3333 4444

(с) Roman Art
So far So good wink

RomanArt's Website

Re: [Solved]Working on the snippset that listing specific blocks.

if wht i understood is correct i will make u a plugin in 10-20 min

(с) Roman Art
So far So good wink

RomanArt's Website

Re: [Solved]Working on the snippset that listing specific blocks.

Yeah, that's exactly what I want to ask.
Pls make it generic so everyone can adapt to their website if you can.

Thanks very much smile

Re: [Solved]Working on the snippset that listing specific blocks.

Qanda, Qs and Answers
php shortcode:

<?php echo Qanda::ShowMe(); ?> 

shortcode:

 {qanda} 

Download here v1.0.0

1) Upload into folder www/plugins
2) Admin panel - Plugins - Install new - Qanda Install
3) Enjoy xD

(с) Roman Art
So far So good wink

RomanArt's Website

Re: [Solved]Working on the snippset that listing specific blocks.

Wow that's fast. Thanks much.

So... we're working on plugin for each set of items, I wish that could be easier to reuse again in the same site for something else.
But I will take a look at the code and I'm sure cloning it will not take a lot of work

wink

Re: [Solved]Working on the snippset that listing specific blocks.

U can create 1000 of questions and answers all of them will perfectly land on ur design, without creating 1000 of blocks

(с) Roman Art
So far So good wink

RomanArt's Website

Re: [Solved]Working on the snippset that listing specific blocks.

Yep, I understand that.

But I also want to have Testimonials, Pricing items, etc... not just QnA. And people may want something else out of it.

But I just take a look, I will write my own Testo, Prite plugin based on your work myself, you comment every line of code in there, so easy to understand even for me smile

Re: [Solved]Working on the snippset that listing specific blocks.

its will be easyer for u if u take a look also at this one Resourses made by nakome i made that plug for u based on his plugin, cause he is the one who made it first, and i was so happy to find it out.

Wish someone can create something like this but with caregories

(с) Roman Art
So far So good wink

RomanArt's Website

Re: [Solved]Working on the snippset that listing specific blocks.

Reading now, the monstra so far so good for me to big_smile