Jump to content

bilioso

Members
  • Posts

    23
  • Joined

  • Last visited

About bilioso

  • Birthday 08/07/1952

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

bilioso's Achievements

Jr. Member

Jr. Member (3/6)

4

Reputation

  1. 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.
  2. @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.
  3. @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.
  4. 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%;).
  5. 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?
  6. 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.
  7. 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?
  8. 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...
  9. 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?
  10. 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.
  11. 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
  12. 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.
  13. 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.
  14. Right on the spot, @MoritzLost. Thanks.
×
×
  • Create New...