mgQuotes

Discussion in 'Subrion CMS Plugins Discussion' started by Eleanna, Jun 10, 2014.

  1. Eleanna

    Eleanna Member

    How do you get this to work? Can't see it anywhere, is it a block? Where is it supposed to be? Can you change the quotes, if so, how?...
  2. Vasily_B.

    Vasily_B. Project Manager

    Hi,

    Please check the installation instruction text from the plugin:
    So this means you can decide where you wish to display a quote, you can create a block or hardcode it to the template directly.

    I believe there is no way to manage quotes - you can only change them in the database table directly.
  3. Eleanna

    Eleanna Member

    Hi Vasily,

    "In order to display random quote please insert this tag in your template: {$random_quote}."

    I'm sure that is the solution, and useful for somebody who knows about programming etc.... However, for somebody who simply wants to use it, and is not a programmer, (or a willing novice like myself) this means absolutely nothing. It then becomes a great incentive to look for another system that does explain things in layman's terms... (That is a comment from one of our customers...)

    Where do you put it in the template? You can put it in a block, you say. How? Very willing to learn, but criptic instructions like this one don't help.
    I did find the zip file with quotes.sql, so I assume it uses its own database, which should be editable. Once I know how to get it going, I'll be able to go in their and change the quotes to what we need.
    Eleanna
  4. Vasily_B.

    Vasily_B. Project Manager

    Ok, add a new block, set its type equal to smarty and put that {$random_quote} variable in the block content. That's it.

    That's a thirdparty plugin, created by our customer who shared it free with other subrion users. You can change in the database - that means you need to use hosting phpMyAdmin tool (or any other) to make changes in the table rows.
    Eleanna likes this.
  5. Eleanna

    Eleanna Member

    Ok, thanks. We'll get this working now. Suppose you want to "hardcode this into the template". I know the quote will appear where you add the variable, but, where do you add the variable? For this particular set-up we are using the Press Mag template with the Publishing package. The quote should appear in the banner space next to the title.
    So, I assume I add the variable in the layout.tpl? I find this piece of code
    </div>
    <div class="span6">
    {ia_blocks block='bannerplace'}
    </div>
    Is that where the variable is added, or am I totally of the mark here?

    Eleanna
  6. Vasily_B.

    Vasily_B. Project Manager

    Yes, exactly you can modify layout.tpl if you need that code to appear sitewide. you can add it in any tpl file.

    You can insert it above your {ia_blocks block='bannerplace'} position, and it will be there.
    Eleanna likes this.
  7. Eleanna

    Eleanna Member

    Great, will have a go at it later. Thanks!
  8. Eleanna

    Eleanna Member

    Ok, just had a go at it, and yes, it does appear, but above the banner space. This potential customer wants it IN the banner space...
    So, I went into the "Simple Banner" Block and added the variable there, like this
    <div class="simple-banner">
    <p>{$random_quote}</p>
    </div>

    This works, but the text for long quotes doesn't wrap in the space. How do I sort that?
  9. Vasily_B.

    Vasily_B. Project Manager

    Just create a block for that position, with smarty type and disable its header - that will work well :)
  10. Eleanna

    Eleanna Member

    I will answer this one myself with an alternative.... Change the line height in the simple banner box. It is set to 88px, by making this 28 or 36 the text wraps nicely in the space...
  11. Vasily_B.

    Vasily_B. Project Manager

    Great you've got it working :)
  12. Eleanna

    Eleanna Member

    Indeed, thanks.
  13. Vasily_B.

    Vasily_B. Project Manager

    Glad to advise.
  14. Eleanna

    Eleanna Member

    Thanks Vasily. One last question. I have been playing with the install.xml file for the mgQuotes plugin, and we nearly have it as we want it. We've put the Author name after the quote, and made the quote bold and italic, as you can see in the "Capture" image. Now we want to clean this up and put the author name ( $random_quote['Name']) on the next line and right aligned, i.o.w. force a line break. Easier said that done it would seem. What I can find is a lot of people telling me that this is easier said than done in sml. As soon as I touch the $random_quote['Name'] variable, the whole quote disappears. Any ideas anybody?

    Attached Files:

  15. Vasily_B.

    Vasily_B. Project Manager

    There could be a way to go, change your hook in install.xml of your plugin:
    PHP:
    $random_quote = $iaCore->iaDb->row(iaDb::ALL_COLUMNS_SELECTION, '1=1 ORDER BY RAND()', 'mg_quotes');
    $out_quote = '<strong>' . $random_quote['Name'] . '</strong>: ' . $random_quote['Quote'];
    $iaView->assign('random_quote', $out_quote);
    let it be as follows:
    PHP:
    $random_quote = $iaCore->iaDb->row(iaDb::ALL_COLUMNS_SELECTION, '1=1 ORDER BY RAND()', 'mg_quotes');
    $iaView->assign('random_quote', $random_quote);
    and now you can use the following smarty variables in your content - {$random_quote.Name} & {$random_quote.Quote} :) You can place them as you need including any html formatting:
    your case:
    HTML:
    <div style="font-style: italic; font-weight: bold;">{$random_quote.Quote}</div>
    <div style="text-align: right;">{$random_quote.Name}</div>
    let us know if you need more assistance.
  16. Eleanna

    Eleanna Member

    Hi Vasily,

    this works great, thanks. The table su_mg_quotes is set to "collation utf8-general-ci"or multilingual, but does not take special characters like stressed letters (é, ά, etc). What am I missing to get it to reproduce those characters?

    Now, a few observations. I know this is a 3rd party plugin, so not really your team's doing, but I think it is necessary for people considering using this plugin to know it that there are a lot of repeated quotes in the database, a good few incomplete quotes (as in cut of in the middle of a word) and a tonne of typos. You really need to go through the database and correct a lot of stuff to make it look ok at the front end.
  17. Vasily_B.

    Vasily_B. Project Manager

    This plugin uses a common dump of phrases available on the net, and if you want you can share it with the others. I'm sure the other people who use it will appreciate your corrections.

    Regarding collations - if it uses UTF8 you should not have any problems with stressed letters, really. Try to correct records using phpMyAdmin or any other tool like that.

Share This Page