Cum sa muti widgets intr-un sablon nou  

Thrown (Ţâpat) in

De cateva luni contemplu mutarea la un nou sablon. Una din probleme consta in mutatul widgeturilor de la cel vechi la cel nou. Iata doua metode.

Prima metoda apartine bloggeritzei dot si a fost postat pe forumul Blogoree (1):

1. Mergi la Layout -> Edit HTML 2. Scroll down pana la sfarsit, la </b o d y></h t m l> (fara spatii) 3. Inlocuieste </b o d y></h t m l> cu <b:section id='backupwidget' showaddelement='yes'/></b o d y></h t m l> (ultimele tag-uri fara spatii) Aceasta va avea ca rezultat crearea unui nou container pt page elements in partea de jos a template-ului. 4. Salveaza template-ul si mergi la tab-ul Page Elements 5. Acolo trage in containerul nou creat, cel din partea de jos, toate elementele pe care doresti sa le pastrezi 6. Salveaza si mergi inapoi la Edit HTML 7. Scroll down pana la sfarsit. Vei observa ca partea adaugata de tine e acum schimbata (s-a adaugat codul corespunzator tuturor elementelor adaugate de tine in containerul respectiv). 8. Copiaza respectivul cod (de la <b:section id='backupwidget' showaddelement='yes'/> pana la sfarsit) 9. Mergi in fisierul xml in care ai template-ul nou, cel cu care vrei sa-l inlocuiesti pe cel curent; acolo inlocuieste </b o d y></ h t m l> cu ce ai copiat anterior. 10. Salveaza fisierul. 11. Layout -> Edit HTML din nou, apesi Browse, alegi locatia fisierului de care vorbeam anterior, apesi Upload, apesi Save. !Atentie: se poate intampla ca noul template sa aiba deja unele elemente din cele pe care doresti sa le pastrezi (ca de exemplu arhiva sau labels). In acest caz cand incerci sa salvezi o sa-ti dea o eroare, elementul cu numele "nume" (de obicei Label1 sau BlogArchive1) exista deja. Solutia este sa te duci la cod, la sfarsit, si sa cauti ceva care arata in genul widget id='nume', si evident, schimbi respectivul nume in altceva wink emoticon (adaugi un 1 or something) 12. Mergi din nou in tab-ul de page elements si iti tragi elementele din containerul de jos unde vrei tu 13. Done. cheesy emoticon < b : s e c t i o n i d = " b a c k u p w i d g e t " s h o w a d d e l e m e n t = " y e s " > < / b : s e c t i o n >

Cea de-a doua metoda apartine bloggeritei de la BloggerBuster (2), care a postat-o in Septembrie 2007:

  1. Log in to your Blogger dashboard.
  2. You will need to be able to edit both your existing blog template and your test blog template, so it's advisable to have two browser windows (or tabs) open at the same time. You can easily do this by keying CTRL+N to bring up a new page. So for the moment your Blogger dashboard will be available in both browser windows.
  3. Now, in the first browser window, select your test blog and go to Template>Edit HTML. Click on the "Upload New Template" link near the top of the page and upload the new XML template you wish to adapt for your main blog. Once this template has uploaded, deselect the "expand widget templates" box.
  4. In the second browser window, select your existing blog template and again go to Template>Edit HTML. Do NOT check the "expand widget templates box", as this will make things much easier for you. Now, locate the widget content identifiers in your template sidebar. Most likely, the section will look something like this: The code featured inside the red box displays the identifying code for your widgets, which calls the widgets to appear in your blog. You need to copy all of these < b : widget ... > sections to yout clipboard, or paste into Notepad for easy editing in a few moments.
  5. Once you have copied the widget identifiers from your old template, go back to the browser window in which you can edit your new template.
  6. Find this section in your blog template:
    < d i v   i d = ' s i d e b  a r    -        w r a p p e r  ' > < b : s e c t i o n    c l a s s = ' s i d e b a r '   i d = ' s i d e b a r '   p r e f e r r e d = ' y e s ' > There may or may not be content here... < / b : s e c t i o n > < / d i v >
    If there are any widgets defined here, it is advisable to delete them. Otherwise you may end up with duplicated widgets. Then in their place, paste the widget codes from your old template:
    < d i v   i  d = ' s i d e b  a r - w r a p p e r ' > < b : s e c t i o n  c l a s s = ' s i d e b a r '   i d = ' s i d e b a r '  p r e f e r r e d = ' y e s ' > Paste the widget identifiers here < / b : s e c t i o n > < / d i v >
    If there are no widgets present in the sidebar of your new template, the code may look like this instead:
    < d i v   i d = ' s i d e b a r - w r a p p e r ' > < b : s e c t i o n   c l a s s = ' s i d e b a r '   i d = ' s i d e b a r '  p r e f e r r e d = ' y e s ' / > < / d i v >
    In this case, you should delete the trailing slash from the end of the line (highlighted in red). Make a line break then paste your widget content as before. Then finally create another line break and add the following line:
    < / b : s e c t i o n >
    The finished result should look something like this:
  7. IMPORTANT! Do not preview your template at all during this process! If you do, you run the risk of duplicating the widgets which will cause you many problems. This seems to be a glitch on Blogger's behalf rather than an error of this method. In any case, do not preview the template.
  8. At this point, you should save the test blog template, after which you can view your blog in the normal manner. You will notice that no widget content is actually showing, only the widget titles. This is perfectly normal: as I mentioned earlier, the widget content is stored in the settings for your original blog.
  9. Okay, now we have copied over the widgets, we can download the XML template ready to transfer over to the original blog. To do this, go to Template>Edit HTML and select "Download full template" near the top of the page. Save the template to your computer with a name you can easily identify.
  10. Now back to the other browser window where you should have the Edit HTML page for your original blog still on the page. Here you should look for the "upload new template" section near the top of the page. Browse for the template you just downloaded from your test blog and upload it. You should NOT receive any error messages, like this: If you do see such error messages, take note of the widgets the template wants to delete, then choose to cancel the process. You should then copy the appropriate widgets from the old template into the new template in your test blog (as before), save the template and attempt to upload it again.
  11. If you receive no error messages, your template will be saved, and you can now view your new blog template with all your old widgets still in place. You can then move the widgets around however you wish in the Layouts section of your dashboard.

Pana sa citesc aceste metode, eu m-as fi dus in codul HTML (ma rog, XML), as fi copiat direct widgeturile si le-as fi pus acolo. Asta nu ar fi mers pentru ca unele widgeturi introduse direct prin modificarea sablonului (Edit HTML) nu pot fi modificate prin interfata de "page elements". Tot astfel, continutul unor widgets de HTML/JavaScript nu este salvat in template ci undeva, in neantul Blogger.

Surse

1. http://blogoree.ro/forum/showthread.php?t=4092 2. http://www.bloggerbuster.com/2007/09/how-i-copy-widgets-from-one-template-to.html

20090810 UPDATE: Vrei mai multe articole tehnice pentru Blogger / Blogspot? Este modificarea de aici curenta, sau am facut una noua, cu acelasi efect, dar mai buna? Toate modificarile aduse de mine acestui sablon (template) pot fi gasite in Zamolxis ChangeLog. Seria lucrand la fatada va gazdui de-acu’ incolo articole despre PR, media persuasion si eventual imaginea Romaniei.

Thank you for reading (mulţam fain pentru cetire)! Publicat Sunday, October 26, 2008 . Similar articles under the following categories (poţi găsi articole similare sub următoarele categorii): (Subscribe) . Dacă ţi-a plăcut articolul, PinIt-uieste-l, ReddIt-eaza-l, stumble-uieste-l altora, trimite-l pe WhatsApp yMess şi consideră abonarea la fluxul RSS sau prin email. Ma poti de asemenea gasi pe Google. Trackback poateputea fi trimis prin URL-ul de sub Comentarii.
Aici vei găsi ştiri inedite, articole hazoase, perspective originale in politică, societate, economie şi relaţii interumane. QUESTIONS (Intrebări)? We got Answers (Răspunsuri există)!  
blog comments powered by Disqus