• Simple way to install Facebook Like Button!#

  • Cupcake Reply #1, 4 months ago

    Reply
    Hello ModX-people!

    I already managed to create a (working!) ModX-site, but I'm not very familiar with all the codes to make things work. (Snippets, chunks, .. for some reason those things never work when I create them) Can anyone tell me in very simple steps how I can add a Facebook Like-button to my Modx site?

    Big thank you!

    Jessie


  • BobRay Reply #2, 4 months ago

    Reply
    If you want a Facebook "like" button, see this. Paste the code into your MODX template(s): http://developers.facebook.com/docs/reference/plugins/like-box/


    ---------------------------------------------------------------------------------------------------------------
    PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
    MODx info for everyone: http://bobsguides.com/MODx.html


  • Cupcake Reply #3, 4 months ago

    Reply
    Oh, thank you BobRay!

    Where do I exactly have to paste that code into?
    Elements > manage elements > (template) > on which spot can I paste the code?
    (It might be a stupid question, but I would like to avoid a blank site or other complications )

    If I could follow a sort of ModX-course I would definitely sign in.

    Jessie



  • BobRay Reply #4, 4 months ago

    Reply
    Click on the "get code" button and it will tell you where to put the two bits of code.



  • Frogabog Reply #5, 4 months ago

    Reply
    Where do you want the like button to be on your page? You can paste the code anywhere you like in the template but it depends on how your template is laid out. Are you calling chunks for the page in the template, or is all your html in the template itself?

    If your template is not using chunks, the get code instructions from FB are accurate and you'll paste them into the actual template exactly as it says. If you're using a header and footer chunk however, and let's say you want the button in the footer, you'll need to paste the script portion in the chunk that holds your opening <body> tag and the html portion into the footer chunk where you want it to display.






  • Cupcake Reply #6, 3 months, 4 weeks ago

    Reply
    Thanks for your answer, Frogabog! I've built the site using the template 'Fractalbroccoli', and I think this template don't uses chunks (but I'm not sure!). I would like to put the like button in the body of my site, so I'll try to follow the instructions! :-)



  • Frogabog Reply #7, 3 months, 4 weeks ago

    Reply
    I located that template, and unless you actually took portions of that template and made chunks (and furthermore, called the chunks from the template with MODX tags), I would have to say that you don't have them. You pasted the whole template code directly into the MODX template, right?

    If so, the easiest way to locate the area that you wish to place the button at is to view your site from MODX using the view button and then use your browser's developer's tools (Firebug or similar) to inspect the code and locate the specific area that you want to place your button. What browser are you using?

    EDIT: Or... did you paste the template code into the content area of your MODX pages? If so, you'll want to back up a bit and use the template instead, leaving the body content area for just the actual content of your pages. You want MODX to use the consistent (unchanging) code from the template in all your pages, leaving just the actual content area editable in the MODX page's content area. Otherwise, there's not much point in using MODX.


  • Cupcake Reply #8, 3 months, 3 weeks ago

    Reply
    Actually I just followed the steps my teacher learned me a few years ago when I had to built my E-portfolio at the end of my studies: choose a template, paste all the code into ModX and change the view of the site by modifying some things in that CSS-file of the template. (You can take a look at the site at www.labradoodle.nl, And the site for my flower shop is made the same way www.atelierdeblomme.be ) I would really like to learn more about ModX and go ‘further’ in those complicated stuff like you guys do. Where/how have you learned about ModX?

    So .. I guess I did the last thing you mentioned: “You want MODX to use the consistent (unchanging) code from the template in all your pages, leaving just the actual content area editable in the MODX page's content area.” It’s really frustrating to not know what I’ve exactly done. Mozilla Firefox is my browser. Thanks again for your reply!


  • Frogabog Reply #9, 3 months, 3 weeks ago

    Reply
    Ugh, I just lost all of what I typed due to Win7 and Synaptics touchpad's useless palmcheck. So frustrating!

    At any rate, I think you'll want to do some deep digging into every MODX tutorial you can find. Use google to search for MODX tutorials, MODX templates, MODX chunks, etc.

    Some (many) of them will be for Evolution. There's not a whole lot of difference in the overall concepts between Evolution and Revolution so for the most part, you can use those tutorials as long as you remember to use the Revolution tags instead of Evolution tags.

    [*content] - Evolution tag
    [[*content]] - Revolution tag


    Insofar as your site - it sounds like you've pasted the code into the content area of the MODX pages. What you want to do is divide that code up into areas that remain constant such as the <head> and <header> (the top of your html file, down through the constant header and menu), and the footer area. These portions of your site don't change often, but when they do you'll want to make one edit and have it dynamically display across your site on all pages. If you have static pages, to make one tiny change in the head you'll have to change every page manually. By putting these portions in either the template or a chunk that the template calls up with MODX tags you can make that change once and then forget about it.

    You can either place these things into chunks or put them directly into the template. I learned the chunk method, so that's what I do. My template looks like this:

    [[$site_header? &showParent=`true`]]
    
     <div class=grids><h1>[[*pagetitle]]</h1></div>
    [[*content]]
    [[$site_footer]]


    The first tag calls up my header chunk which is a chunk I made that holds everything from the top of the pags down to the menu. Then you see a <div> which holds my pagetitle (pulled from MODX) which displays right under my menu. Next is the site content which comes from that area in the pages where I think you pasted your code. After that, is my footer chunk. That's it for my template. I could have any number of page templates with different looks calling different chunks.

    You can however, put your html into the template itself and not use a site_header chunk but for me, that's how I learned it and I'm likely going to stick with it.

    You will get the same result from using chunks as you will from using the template itself to house the un-changing html for your pages. Change a chunk, it changes across the site wherever you call that chunk. Change the template, it changes on every page that you use the template on. Easy!

    In it's most basic concept... that is what MODX does to make your life easier. But it does much much more and you'll want to use things like Wayfinder to call up your menu so that if you create a new page, it automatically adds it to the menu instead of you having to go into the menu and manually code it in. For other constants (such as sidebars or other chunks of information on your site that you will want to insert and remove on different pages as you desire) you'll want to put those things into chunks and TV's which you'll simply call up with MODX tags wherever you want them placed. The chunks hold the actual code, and the TV's allow you to change the information that the chunk displays. It should all fall together like a puzzle that you can change the look or content of each piece or use the same puzzle piece over and over again anywhere you want without having to write any new code. Ideally... lol

    A bit of warning... it does take time. I've been working with MODX, teaching myself (a 41yo mama of 3 who created her first database on her dad's IBM XT in 1986) EVERYTHING from beginning html and CSS, PHP and mySQL, JavaScript, etc for a couple of years now. I knew lots about computers in general, but next to nothing about websites. I found MODX a little over a year ago and have quite a few local MODX sites on my machine just to practice with. I've been recently introduced to WordPress because a client who chose not to hire me and let a friend set up his site has now asked me to fix it. UGH! OK, it's all kinds of awesome in so far as getting something done quickly and easily but it's also frustrating because it's not MODX and I get what I get for the most part. I know MODX can do all that WP does and a million things more, and furthermore I can make it do it my way instead of someone else's. I've decided to focus on html5 and css3 and responsive web design instead of look too far back to the past and re-invent the wheel. MODX allows me to do that. In WP... I get... whatever I get and all it really is, is just a blog that people have made work for commercial sites. I find it more frustrating to back track and re-do than to just do from scratch usually.


    As far as tutorials, just search for them. Google with "MODX" in your search string and it'll all show up. A few of my favorites are:

    http://codingpad.maryspad.com/tag/modx-tutorial/ (Evo and Revo are different, yet similar - just note it)
    http://sottwell.com/
    http://bobsguides.com/
    (anything in the above three sites are pure gold - read!)
    http://designfromwithin.com/
    (fabulous tutorials and videos)
    http://modxrules.com/
    http://wiki.modxcms.com/index.php/Beginner's_Guide_to_MODx (this is for Evolution, but it's worth reading as long as you differentiate between Evo tags and Revo tags plus some other things that don't apply to Revo - you'll see...)

    And of course, the official docs at:
    http://rtfm.modx.com/display/revolution20/Home

    You can search youtube for MODX, and a number of videos are available on Vimeo as well. The videos really do help so watch whatever you can.

    Additionally, I can't recommend more to get a copy of the MODX - The Official Guide by Bob Ray http://modx.com/learn/modx-books/modx-the-official-guide/. I just got my copy yesterday and went directly to the php appendix with my highlighter. That's one thing that I am ultra confused about and I have to say that after reading and highlighting for just a couple of hours, things are finally beginning to fall into place. I'm so happy to have it in my hot little hands. Now if I could figure out exactly how to set the toPlaceholder property to "files" without mucking up the rest of the properties...


















  • Cupcake Reply #10, 3 months, 2 weeks ago

    Reply
    Dear Frogabog

    So much thanks for your reply! It was such a busy week I didn't even manage to check my mails, I apologize for my late reaction. Tomorrow I'm going to read all your information carefully, and I'll also give it a try with my like-button ... (I'll post the result, fingers crossed!)

    Greetings
    Jessie