Jump to content

RuiVP

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by RuiVP

  1. My mistake. Some old hanna codes are working. But introducing new ones and autocomplete is not working.
  2. Thanks, I followed your advise and everything seems to work ok until now.
  3. Hi, I'm afraid to migrate my text fields from ckeditor to tinyMCE because I have a few hundred pages possibly with hanna code markup. Will tinyMCE wipe out hanna code markup? And, in that case, is there a tested solution to keep those pages integrity? Is it possible to add a button or a menu (in tinymce) to insert and edit hanna code? Or do I have to hard code it in the code window?
  4. Ups... OK, I found the garbage icon on the images. Still, I don't know if there is a replacement utility.
  5. I need to replace some images in a page and also to delete some images in the page - I mean in a field: images. I can't find an easy way to do that, specially from the point of view of someone editing the page. What am I missing?
  6. My mistake! You are right, it works as perfectly. It also works for align_center, of course. Simple and brilliant. Problem solved. Thank you, you applied a lot of effort and time to crack my problem. (my silly mistake: I was injecting in Firefox ".align-left" instead of ".align_left") Thank you again! Community is a wonderful thing.
  7. @Jan Romeromany thanks for your effort! Unfortunately it doesn't work as expected. It is equivalent (I think) to Ryan's CSS trick "figure {width:1px;}". I tend to believe there is no CSS solution for this problem, because, as far as I know, CSS doesn't have ascendant selectors (something like "parent < child {some: rule}"). Although I'm not sure, I think I would be able to build some HannaCode to 1) accept an img, 2) accept a width attribute, 3) insert the img it inside a figure, 4) add a figcaption and 5) retro-style the figure element accordingly to the img width - and finally render the whole thing. However, that would force the editor to make a tricky choice of images based on image:n. That's not comfortable and, in a non-profit, pro bono, voluntary site like this, that would make editors run away, according to my experience. Maybe the only practical solution is the good(?) old table with 2 rows: one for img, another for caption, specifying a table width. That's fairly practical to do in CKEditor.
  8. @Jan RomeroIn fact I would like to keep the freedom to choose the image size in each case, not to «normalize» the images. Using the inspector in Mozilla, I confirm that the right way to do it would be to style the figure element (not the img element) on a each case basis. But I don't know how to do it through the images field or how to change the module to get there. Hopping someone has an idea to help me.
  9. My question is about the appearance of images and captions (inside a figure element) in the frontend. As far as I know, CKEdit has a different mechanism/styling and I'm not worried about it. Of course, if I take the trouble to manually insert an image and a caption inside a table, and configure the table, etc., the problem goes away, but... isn't it the automatic procedures and machine help what we are all hopping for, for the sake/save of time and work? My relevant CSS: .align_left { /* for images placed in rich text editor */ float: left; margin: 0 1em 1em auto; position: relative; top: 0.5em; max-width: 50%; } .align_right { /* for images placed in rich text editor */ float: right; margin: 0 auto 1em 1em; max-width: 50%; } .align_center, .align_center img { /* for images placed in rich text editor */ display: table; margin-left: auto; margin-right: auto; /*position: relative;*/ /*top: 0.5em;*/ } figure { display: table; /* width: 1px; */ margin: 1em auto; } figure.featured_image { margin: 0; width: 100%; } figure img { display: table-row; /*margin-bottom: 0.5em;*/ } figure figcaption { display: table-row; font-size: smaller; color: #777; line-height: 1.4em; } .align_center figcaption { text-align: center; margin: auto; } The base site is https://cadpp.org/ . It is meant to be a very simple (simplistic?) site, without bells and whistles. An example of the problem I'm trying to report would be https://cadpp.org/artigos/a-mundializacao/#this-is-bad-graphics Please note that I will undo this image caption example as soon as possible, because it is breaking my page. Before preparing this example for you, and in order to turn around the problem, I manually broke the caption into 3 lines, using <br/>. Also notice that the only thing preventing the caption from occupying all the container width is the fact that I added a limit to the right|left-aligned images in the CSS file (max-width: 50%;).
  10. Hi, I'm having a problem, but I'm not sure if I am missing some configuration items or if this is a internal feature to the images modules. Here goes my problem (sorry if I'm not able to explain it in a synthetic way): When I insert a img with figcaption in the body text (through the images field), the caption doesn't fit the image width. Meaning: Suppose the image is centred and 50% wide relative to the #content container, but the caption being very long, it spreads to 100% of the available space. The same thing happens if the image is left/right aligned to text. This is graphically wrong (according to the usual typographic rules) and visually confusing, because you cannot distinguish immediately the caption from the following normal body text. Apparently, this means the figure element (defined as a display=table in the default css) expands to the entire available space, exceeding the image width. Shouldn't the width, in the images module, be assigned to the figure element (table or otherwise), instead of the img element? Or... am I missing something in the configuration/use of the images field?
  11. OK, I already figured out I should replace 'localhost' with 'mysite.org', (The problem was that on first try to solve, I wrote 'https://mysite.org') And I put on the config->httpHosts = array('localhost', 'mysite.org'); or should I write array('localhost', 'https://mysite.org', 'http://mysite.org') ? or should I change the order? I don't know exactly how to do it (I simply try by error and success), but I already understood that with certain configurations, ckeditor, for example, looses track of mystyles.js.
  12. HI, I developed a site in a local machine and now I transposed it to a server. Until now everything seems to work fine. However, there is a problem on edit mode: I can change the fields, save them, but when i click the «view» button, it directs to https://localhost/somepage (which goes no where) instead of https://mysite.org/somepage The only way to get back on track is to handwrite the right address on the address bar of the browser. In config.php I have: $config->dbHost = 'localhost'; $config->dbName = 'xxxxxx'; $config->dbUser = 'xxxxxx'; $config->dbPass = 'xxxxxx'; $config->dbPort = '3306'; and $config->httpHosts = array('localhost'); What should I do to get the base address all the time?
  13. Oh my... My mistake, the bug was on me... Please forget this message or, even better, erase it, to avoid my shame. Just to clarify: I am using the same function in several templates, to render the tags, and the bug was in there: function commatedList(PageArray $items) { $out = ""; if($items) { foreach ($items as $item) { if($item == $items[0]) { $out .= "<a href='{$item->url}'>{$item->title}</a>"; } else { $out .= ", <a href='{$item->url}'>{$item->title}</a>"; } } } return $out; } As you can imagine, the problem was: $out .= "<a href='{$item->url}>'>{$item->title}</a>"; Also: it may be bad programming, I know, but anyway I'm not a programmer, so...
  14. I have an input field PageReference in my templates. It is meant to work as tags and it references pages with a «etiquete» (=tag) template. I can input new references and they render fine in the page, but the url renders wrong. As an exemple, I get: <a href='/mysite/mytags/sometag/>'>sometag</a> instead of <a href='/mysite/mytags/sometag/'>sometag</a> I'm building the site in a Wamp local server. Working with PW 3.x Is it a bug or may I be doing something wrong?
  15. Thanks, Snobjorn. Much cleaner now. However, it turns out that the selector doesn't accept variables and operators like $page - the concept is right, but the peace of code won't work. The solution I could find: $selector = "template=article, fieldAuthors=" . $page . ", sort=-published"; $articles = $pages->find($selector); foreach($articles as $article) { #... } Note: The messy nested iteration in my first solution resulted from my (wrong) notion that because fieldAuthors is an Array, I should iterate to find the right value. Well, I was surprised to find out that the selector "fieldArray=someValue" magically iterates through fieldArray to find someValue. The code is working, but please correct me if I'm wrong on this note, I don't want to induce other apprentices into mistake. Otherwise this issue is solved.
  16. Sorry, silly me. I found the origin of my failures on points 1 & 2 reported in my previous post: 1. & 2. After loading the plugins into /site/modules/InputfieldCKEditor/plugins I simply forgot to activate them in the setup of the field where I want to use them, e.g. setup > fields > body > input > plugins > extra plugins
  17. I'm having difficulties on building some aspects of my site, namely with textarea/ckeditor input fields. 1. <no break space> is an essential feature to my site. I tried to install a ckeditor plugin for &nbsp; but it doesn't work. Is it possible I'm doing something wrong, or doesn't the PW's ckeditor accept plugins? 2. <footnotes> is another essential feature in my site (lots). Same problem - tried to install the ckeditor plugin without success. Or: is there common alternative solutions to use notes in a html page? (I mean, not necessarily foot-notes) 3. When there is a link with an associated anchor, on calling the editor window for the link, the PW links plugin for ckeditor wipes out the anchor. Annoying. Is there a solution for this? 4. This brings me to an old situation: I always had problems and limitations with ckeditor, which always led me to opt for tinymce in my previous sites. But, as far as I can understand, PW 3 doesn't support any more tinymce. Am I wrong? 5. <images> input field does not allow for using a css class. I couldn't find a module to solve the problem, is there one? 6. What is the best practical solution to insert images residing somewhere in the net, without having to go fishing inside the html code source for the text? Thanks in advance for any help.
  18. I'm still working on migrating my site from Drupal to PW. It will take very long, because I have to do it in my spare time, which has been none lately. My experiments on this subject are not interesting, compared to some other threads on the same subject in this forum and I would not be offended if the moderators opt for deleting this thread, namely to avoid confusing more other newbies. Nevertheless, I will add now some thoughts about my ingoing migration process: 1. You were right about the importance of making a mirroring field for the Drupal pages id. In fact, I restarted all the migration process from scratch, creating in the PW templates lots of fields to accommodate every kind of value existing in Drupal pages. It turned out to be very useful and I can delete them on PW any time, once the migration process is completed and tested. 2. Migrating multivalued fields is not as straightforward as I would like... It requires some programmatic solution I don't have the skills to implement. Fortunately my site has only a few hundreds of pages and I'm willing to do some kinds of adjustments manually (or, in this particular issue... to give a try with Tracy debugger, via "exploding" an exported line of text from Drupal, containing several values comma separated, and injecting each of them into the corresponding field_pages in PW). 3. My advise to other people facing the same kind of migration: study in-depth the CSS rules in the old site (in my case very flourished and with lots of variants inside the articles) and than try to rethink the CSS rules in the new site using the same naming, otherwise you will end up with a big mess, most of the articles visually destroyed and a lot of work to do by hand. Unfortunately, I didn't do it... On top of that, be prepared to see some CSS formatting (classes and so) magically disappear during the import.csv process (sanitized?). 4. An unexpected problem arose from the combination of stats and pages in different languages. Apparently, Drupal and PW approach the languages issue in different incompatible ways. As far as I understand, Drupal creates different pages (different id) for each language version; PW creates a single page (single id) for any number of language versions on the same page. This results in a major problem, because I'm required to show in the final rendered page the total amount of visits for each page, since its creation. Certainly there would be a smart automated solution for this, but once again it is out of my reach. Plus, I found only 2 modules for counting visits: ProcessPageViewStat and PageHitCounter (simpler and easer to manipulate). But... they are not prepared to deal with languages! And I'm not prepared to transform them into language-aware modules, so this is a problem with no solution at sight. 5. Finally, I gave up manipulating the native "published" field in PW. It is a too messy operation. I opted for creating a new published-date-field - editable by hand, but self-filled with "today date" by default.
  19. Right on the spot, @MoritzLost. Thanks.
  20. My main.php template has <html lang="<?php echo _x('default', 'HTML language code'); ... > and it renders <html lang="default"> instead of <html lang="pt">. As a result, CSS specification {hyphens: auto} will not work. Any ideas how to solve this?
  21. Ok, supposing a template Author, and a template Article with a fieldAuthors (page reference, multiple), the dynamic part of the Author template now goes: $articles = $pages->find("template=article"); foreach($articles as $article) { foreach($article->authors as $author) { if($author->id == $page->id) { // ... some stuff } } } and there it is, the list of articles for that author, next to his/hers pretty face. I imagine it is bad coding, but it works.
  22. Thank you all for your good advises, @dragan , @szabesz , I'm learning a lot thanks to you.
  23. Thanks, @dragan, you were right, of course: the use of a reserved word was a major problem. As for Tracy Debugger , I was already using it (although I think I'm not getting the debug output)[*]. Now the page renders (with my previous code it always crashed without rendering, ). However, even after changing names of the variables, it was not showing the list I intended. It took me half a day of experiments to find out that there is another essential point to put it rendering: // referee pages from Article to Author $articles = $pages->find("template=artigo"); ... foreach($articles as $article) { if ($article->int == $page->id->int) ... ; } ... First: I had to use find() instead of count() to avoid problems. Second: there is some problem/specification with the page reference field I can't get right. Finally I discovered, by random experiment, that I have to declare both the reference and the id of the page as integers (which I don't know how to do it in php, it was a wild guess). Then (finally!) it renders ok. But it is not yet right: Tracy debugger still reports error «PHP Notice: Trying to get property 'int' of non-object ...» Since I can see that several modules (including Tracy Debugger) also have error reports on running, I suppose I should not get anxious about it, since it renders fine. I'm ready now for the next trouble on migrating from Drupal to PW. (*) Side note with absolutely no interest for this case: I can see PW is simpler, cleaner and more elastic than any other cms I came across before. And, as far as I can see, it is perfect for my site needs. Unfortunately, I'm afraid I will never be able to take the most of it. Not because of PW, but because of my personal idiosyncrasy, which makes me unable to learn php, as if there was a concrete wall between me and the language. Two factors intervene: First, the fact that the only programming language I learned and played around a little bit with (apart from Basic, 50 years ago) is Smalltalk/Squeak. After learning ST, php looks like a wild jungle with no sense and a dirty inhuman syntax. I would not complain and it would be much easier for me if I was total virgin in programming, I guess. Secondly ... well, I can imagine that my 68 years old are not helping to learn fast... However, I will insist a little bit more to see if I can migrate my site to PW. It is the most elegant system I ever tried.
×
×
  • Create New...