Hi Guys,

I'm wokring on a patch/feature request, for the FLEXINODE.MODULE that has been asked many many times on here. And that is how to theme flexinode content at the $content level.

It's based on code that Kiev1.org has pulled together and I have uploaded a simple patched version of flexinode.module (4.6.x) to my sandbox.

The purpose of this thread is to tidy up Kiev1s code so it can be submitted as a patch properly for the flexinode.module.

The key functionality of the patch is as follows:

  1. Allows users to very simply and easily customise the way teasers and full nodes are displayed for each flexinode type from within Drupal.
  2. The Fleximax patch strips out the $node->flexinode-n fields an replaces them with simple to use {n} fields you can insert within custom HTML code to get very flexible with your layouts.
  3. The interface is illustrated in this screenshot. You simply go to ADMINISTER -->> CONTENT -->> CONTENT TYPES and click on the appropriate EDIT CONTENT TYPE link to customise the layout.
    The fleximax patch automatically generates a list of flexinode fields for you on that page, so it makes it very simple and intuitive to use.

I have been using it for a few days and I have found it very useful to the point that I think it might be a good addition to the core flexinode.module.

Click to download the fleximax patch of flexinode.module
(it's very easy to install if you already have the fleixnode.module installed. Full installation instructionsare included in the readme.txt in that folder)

Screenshot of the fleximax patch interface and a good illustration of how it works

The nice thing about the patch is that it will work with all template engines. Discussions on this topic tend to be centred around phptemplate based themes.

I've tested it in drupal 4.6.x and it works well. So you can use as is if you want. I hope that helps other newbies like me who found it tricky to pull together override files.

Dub

P.S. I have called it fleximax.module in the sandbox to avoid confusion with people searching for the proper flexinode.module. It is not intended as a new module but as a patch for flexinode if people find it useful and if JonBob (flexinode.module maintainer) deems it worthy of inclusion.

Comments

profpek’s picture

wow can see how this will make things easier. Does this give the {n} fields classes that you could use to also style with css

Ric

Dublin Drupaller’s picture

Hi Ric..

I'm playing with it at the moment to see if it is worth tweaking the TABLE display of flexinodes and displaying images etc. To answer your question, you can specify custom classes in the html you insert...it strips out the $node->flexinode-n fields and replaces them with easy to use {n} fields. So you can wrap the {n} fields with specific classes within the custom html .

hope that helps

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

profpek’s picture

the penny drops:) thanks

Ric

sami_k’s picture

I personally think it's definitely worthy of addition. Though it may be a bit too technical for some types of users, I think it's a very cool option to have.

--
Please read the handbook, search the forums, then ask...
http://drupal.etopian.net (Modules and Drupal Services)

restyler’s picture

Looks really useful for me. And seems to work ok :)

--
RussianWebStudio: improving the web

kiev1.org’s picture

Thanks! It was simple for making, but all the same there a code it is necessary to clean - there pair insignificant mistakes - it is necessary to insert some additional checks, but it then and where the most important - double resize images :)
The most important is a new work with field Image - the image passes 2 stages resize - 1 - up to max and 2 up to thumb - according to parameters of a field image so the signature to the image is added.
By pressing in node on thumb jumps out pop-up a window with max the image - for editors of a site it extremely important what to not do it manually.
It is necessary to add here too it is very important - thus we can do for example a photo gallery - and all by one simple module

Dublin Drupaller’s picture

Hiya,

the functionality is great, but as you can see here: http://drupal.org/node/29529 the code needs to be tidied up and tested properly before submitting for a patch.

The plan is to use this thread to iron out any problems/extra functionality and tody up the code before submitting the patch.

Hope that makes sense.

You can follow the development here:view changes to the fleximax.module

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

Simply do not forget:) That you will help to correct for thanks for that:) I badly program, but it is a lot of ideas-:) thanks!

Dublin Drupaller’s picture

Sorry I didn't mean to intonate that you programme badly...it's just that the patch isn't done in a way that is simple and easy for other drupal developers and patch reviewers to understand..

the way drupal works is there are a lot of contributers who submit code to be included. either in the core drupal modules, as a brand new add-on module or as an improvement (patch) to an existing module.

everyone has their own little quirks and ways of writing code...and if it's done in a production scenario where a deadline might be looming it can be clubbed together in a way that works, but, in a way that is not easy for someone else to understand when looking at the code.

i thought that your patch idea is superb and the only thing holding it back was tidying up the code, hence this thread. Where others can help/suggest/tweak the code before it is submitted as a patch.

I hope that makes more sense

dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

Thanks you! All is correct! Excuse
Forgive my English - I use the computer translator
I simply very much hastened:) but it is unimportant, - there at image resize it is necessary to pay attention to that that in php on some systems is required absolute path and with relative does not work is is made in haste and it is necessary to correct for it. And still - there the note to the image is made in the form of a separate field in the table flexinode is it seems not correctly, correctly it to place in serialize a field - but then we cannot deduce it in a column in flexinode table - and it is often necessary, therefore so is left.

Following idea a html pattern for a conclusion flexinode table (/flexinode/table/1) plus a conclusion not /flexinode/table/1/ flexinode/table/2/ flexinode/table/3 - It will agree looks not ended, But an opportunity to establish the filter on taxonomy and the dictionary - plus chekbox-s for necessary fields to a conclusion (Instead of unmarked - in a pattern can get "& nbsp;" )- plus an opportunity to present all filter in the form of one reference - and we have an opportunity creations of catalogues or even simple databases. Field image should be thumbnail instead of a name of a file - Or for example: we send node-s where many images - can be presented all images of documents in the form of a photo gallery (through flexinode table) :) also there is no necessity in parallel to create a photo gallery

Dublin Drupaller’s picture

Hi Kiev,

I'm looking into the thumbnail/image thing at the moment. Can you try again at explaining what you mean re: the table idea?

Appreciate that those computer translators are sometimes not the best, but, here's a few guesses at what I think you might mean:

"conclusion flexinode table"?

Do you mean inclusion of a flexinode table text area, where people can specify specific layouts for how the flexinode/tables are displayed?

"establish the filter on taxonomy and the dictionary"

Are you saying we should include a checkbox/dropdown option in the EDIT CONTENT TYPE area to "hook" the flexinode into a specific taxonomy term or category?

With a view of using it to build up a flexinode catalogue..like a classifieds or shopping catalogue..to use an example.

"field image should be thumbnail instead of a name of a file"

I'm looking into this at the moment, i.e. let's say the image field is called flexinode-field-3. We know it's an image because of the field-type, so we could treat them differently to normal flexinode fields and offer the option of inserting {3a} or {3b} into the flexiMAX layout where {3} is the full image and {3b} is the thumbnail.

Is the above close to what you meant?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

Thanks, you not forgotten about me - usually everyone ignore me:)

>Do you mean inclusion of a flexinode table text area, where people
>can specify specific layouts for how the flexinode/tables are >displayed?
Yes so

>Are you saying we should include a checkbox/dropdown option in the
>EDIT CONTENT TYPE area to "hook" the flexinode into a specific
>taxonomy term or category?
Yes so

>With a view of using it to build up a flexinode catalogue..like a
>classifieds or shopping catalogue..to use an example.
Yes! For this purpose also has been conceived flexinode, but it simply is not ended!

>field image should be thumbnail instead of a name of a file
>Is the above close to what you meant?
No
I meant flexinode/table - now in flexinode/table instead of the image the name of a file is displayed, and the image is necessary is simply to make, but it is necessary to add all over again a html pattern for flexinode/table

>inserting {3a} or {3b} into the flexiMAX layout where {3} is the
>full image and {3b} is the thumbnail.
It is excessive: image resize it is enough 2 - thumb and pop-up - In html a pattern it is enough that it was one object - at viewing - thumb - by pressing - pop-up is should be rigidly connected and it is not necessary to divide thumb and max - It is checked up, - all should be as much as possible simple, without excesses, any superfluous command in a code and in logic of work are inadmissible :) - thumb and max - one object.

Dublin Drupaller’s picture

Hi Kiev..

you said:

I meant flexinode/table - now in flexinode/table instead of the image the name of a file is displayed, and the image is necessary is simply to make, but it is necessary to add all over again a html pattern for flexinode/table.

I think I understand what you mean..when an image is selected to appear in the FLEXINODE TABULAR view, it appears as a file name by default, as opposed to a thumbnail/image. Hence, it might be useful to have a third "FlexiMAX table" textarea on the DEFINE LAYOUT page that allows users to specify the tabular view layout.

Do you have an example of how that could be implemented simply in the the latest fleximax patch module?

I understand how simple it could be to insert a new textarea, but, not how to override the default flexinode tabular view.

It is excessive: image resize it is enough 2 - thumb and pop-up - In html a pattern it is enough that it was one object - at viewing - thumb - by pressing - pop-up is should be rigidly connected and it is not necessary to divide thumb and max - It is checked up, - all should be as much as possible simple, without excesses, any superfluous command in a code and in logic of work are inadmissible :) - thumb and max - one object.

Do you mean like this?

http://www.cssplay.co.uk/menu/boats.html

I think if users have the option of inserting a simple tag, such as {3a} where flexinode-field-3 is an image and {3a} is the thumbnail it will allow them to do whatever popup stuff they want as opposed to making a popup as default..

As I see it, one of the tricky parts of implementing the FlexiMAX patch module is the fact that the flexinode theming is hard coded into the module and not simple to disable.

I prefer fhamiltons suggestion of displaying the default flexinode theming in the FlexiMAX text areas where users define the layout. So instead of seeing something like this:

Flexinode Fields available
---------------------------
ID=4 Postcode (edit field)
ID=8 Website (edit field)
ID=9 Photo (edit field)
ID=12 Genre/demog/notes (edit field)
FlexiMAX layout
----------------
<br>{4}<br>{8}<br>{9}<br>{12}

They see this:

Flexinode Fields available
---------------------------
ID=4 Postcode (edit field)
ID=8 Website (edit field)
ID=9 Photo (edit field)
ID=12 Genre/demog/notes (edit field)
FlexiMAX layout
----------------
<div class="flexinode-body flexinode-1">
<div class="flexinode-textfield-4"><div class="form-item">
{4}
</div></div>
<div class="flexinode-textfield-8"><div class="form-item">
{8}
</div></div>
<div class="flexinode-image-9"><div class="form-item">
{9}
</div></div>
<div class="flexinode-textarea-12"><div class="form-item">
{12}
</div></div>
</div>

Actually. The above is precisely whet the default fleixnode DIV and class wrapping looks like. No idea why there is an extra form-item class.

If we follow Fhamiltons idea, it puts total control in the hands of the users, there is no extra unnecessary code being generated in the pages and it gives the users better CSS control over their flexinode content while still allowing for the default to be applied.

Hope that makes sense..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

help-my
http://drupal.org/node/30499
I test despair, a shock, horror, - the module menu- 2 day :(
And anybody, to help me: (
Created menu items it is not visible also they do not reveal

>I think if users have the option of inserting a simple tag, such as
>{3a} where flexinode-field-3 is an image and {3a} is the thumbnail
>it will allow them to do whatever popup stuff they want as opposed
>to making a popup as default..
It is not necessary when the size of the image less in thumb - that pop-up a code is disconnected automatically
hard coded In this case it is correct - never simply other variant of display pop-up is required is a truth - let remains as is - that is without complications
I have thought over all - to complicate it is not necessary

> <div class="flexinode-textfield-4"><div class="form-item">

This your correction - I against div-s in a code (div class = " flexinode-textfield-4) - my code such does not do - styles it is necessary to write all in a pattern
--
If completely to separate raw data from for example links or image field separate to thumb, max-thumb and to write links directly in a pattern - then it is necessary to present somehow id node and etc - then we shall create new language and many complication - or we shall reach that that all php a code we shall transfer to a pattern - that too not right

All should be simple, but div-s should be transferred from a code to a pattern completely

Dublin Drupaller’s picture

Hi Kiev..

I see your point about hardcoding styles like that, but, in the context of phptemplate and the ability to add flexinode-n.tpl.php overrides, it makes sense in the bigger picture.

I think you mis-understood my post, by the way, I'm not suggesting we hard code in theme styles...

At the moment it's very difficult to override the default theming function that is built in to flexinode. i.e. it's not easy to create a patch.

Fhamilton came up with a good suggestion to work around that by displaying the default flexinode styles in the flexiMAX layout area. That maybe an easier patch to apply and maintains the ability for more advanced drupal users with PHP programming knowledge to create their override files.

So, as I see it, one of the tricky parts of implementing the FlexiMAX patch module is the fact that the flexinode theming is hard coded into the module and not simple to disable.

I prefer fhamiltons suggestion of displaying the default flexinode theming in the FlexiMAX text areas where users define the layout. So instead of seeing something like this:

Flexinode Fields available
---------------------------
ID=4 Postcode (edit field)
ID=8 Website (edit field)
ID=9 Photo (edit field)
ID=12 Genre/demog/notes (edit field)
FlexiMAX layout
----------------
<br>{4}<br>{8}<br>{9}<br>{12}

They see this:

Flexinode Fields available
---------------------------
ID=4 Postcode (edit field)
ID=8 Website (edit field)
ID=9 Photo (edit field)
ID=12 Genre/demog/notes (edit field)
FlexiMAX layout
----------------
<div class="flexinode-body flexinode-1">
<div class="flexinode-textfield-4"><div class="form-item">
{4}
</div></div>
<div class="flexinode-textfield-8"><div class="form-item">
{8}
</div></div>
<div class="flexinode-image-9"><div class="form-item">
{9}
</div></div>
<div class="flexinode-textarea-12"><div class="form-item">
{12}
</div></div>
</div>

Actually. The above is precisely whet the default fleixnode DIV and class wrapping looks like. No idea why there is an extra form-item class.

If we follow Fhamiltons idea, it puts total control in the hands of the users, there is no extra unnecessary code being generated in the pages and it gives the users better CSS control over their flexinode content while still allowing for the default to be applied.

Hope that makes sense..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

> They see this:
yes - it is right - This all so is natural
I am exact at once not think

> it puts total control in the hands of the users
It and should be, but image thumb - hard coded

Dublin Drupaller’s picture

I think it's easier for the user to setup the flexinode with 2 image fields..one for the teaser and one for the node.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

in teser at me disabled pop-up code - it is usual standardly for design of sites

Dublin Drupaller’s picture

Hi Kiev,

maybe I misunderstand what you mean by Pop-ups.

Pop-ups are something that I detest on websites and have my browser blocking them, as most people do. As far as I know it's something that is shunned upon.

in case it's a language thing and you mean something else, can you post a simple html example of your pop-up? or post a link?

Hope that makes sense

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

Here the example - by pressing a picture jumps out its full image - so the optimal to do - on another and to not think up:)
http://news.orthodoxy.org.ua/node/57

Dublin Drupaller’s picture

HI Kiev.

Had a look at the example and I like it. Although I don't think we should hard code that into the fleximax.patch

It would be better to create a new field_image_popup.inc file that goes into the module folder that automatically wraps the image file in the appropriate code that creates the popup.

That is a simpler way of adding that in and it is optional for the user. So it keeps things much simpler and at the same time avoids forcing the user to use it, as it's an option, extra field they can choose when determining their content type.

I can help with the english description and instructions for users, if you need a hand.

Here's a link to the standard field_image.inc file

I hope that makes sense. While the popup functionality is useful, I'm trying to keep the patch as simple as possible and avoid hard coding stuff in.

The key stumbling block at the moment is applying fhamiltons idea, which would make the patch complete and I think it would warrant formal submission at that stage.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

> Although I don't think we should hard code that into the
> fleximax.patch
It all already is present in my path for image.inc

> to create a new field_image_popup.inc
Yes, сertainly

>at the moment is applying fhamiltons idea
There it is simple, it is necessary in a pattern by default hardly hardly to correct,

kiev1.org’s picture

Nearly has not forgotten! It is necessary to add checkbox near to the image for removal of the loaded image at editing

Dublin Drupaller’s picture

HI kiev,

Good point..is that a seperate patch for field_image.inc or is it something I could include in the fleximax.patch?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

It is necessary for including in field_image.inc
Thanks for your work!

Dublin Drupaller’s picture

No worries..you're welcome.

well done for spotting the delete-image option on the edit page. Good idea. before submitting that patch for the field_image.inc file, Kiev, I recommend you go through the how to contribute patches guidelines which explains, step by step how to submit a patch.

it will be useful for the field_image_popup.inc idea you had as well.

give me a shout if you need a hand with the english description text etc.

hope that makes sense..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

>Good idea.
:) Yes, but I yet have not embodied it in a code, but I sooner or later shall make it, I now am borrowed by little bit another

> how to contribute patches guidelines
Use of unix like utilities is natural to me I have no difficulties with utilities diff and patch because for a long time I use linux gentoo... However I the layman

>...with the english description text etc.
thanks You! I have many ideas but I very slowly work :)

Dublin Drupaller’s picture

Hi Kiev,

Was just testing the taxonomy side of FlexiMAX and it's not necessary to patch in anything for that....if a taxonomy term is setup that includes the Fleximax content types, the taxnomoy option is automatically included in the CREATE CONTENT -->> [name of content type] or EDIT page.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Bèr Kessels’s picture

When time permits I will read carefully trough the code, for this indeed sounds like an extremely valuable asset!

For now I only have one small comment, regarding the syntax of the 'template':
I disike the use of {} or any other ascii characters. I dislike [[wiki]], Though in Drupal the use of [tokens:ID] is very often used.
But abovethat i prefer simple php:
<br/>$foo<br/><p>$bar</p>
Or even a better syntax:
<br/><?php print $foo ?></br><p><?php print $bar ?></p>

Off course that is much more complex then the proposed tokens, but it gives much larger power. Think abuot foreaches, if-then-elses, and other code. While it is sill simple enough for users to get to learn.
I dislike other syntaxes, because they prove to be either too limiting, or -when extended- become a complete new languagen, taht is much harder t learn. I for one, know HTML, so I simply refuse to learn another HTML alike language like wikisyntax.
Think also abotu teh populaity of PHPTemplate (simple PHP) over the Xtemplate or even smarty syntax. That is because PHP is well known, well documented, and well thought out, while Xtemaplte or smarty are never as powerfull, yet in the same time as simple.

And on top of that, we need not work with IDs. IDs are very userunfriendly. Especially when it is perfectly possible to work with $strings that explain what they do: $small_image is much easier then {12}.

If we choose for the $only, without the <?php print part, that will look easier, yet take away that power to use ifs, loops etc. While we, in that case, can simply re-use the core drupal PHP filters and settings.

And a comment about themability, or more of a question, request.
ATM flexinode can be themed very well, using theme functions, advanced phptemaplte templates etc. We should -at all costs- maintain that power. And on top of that, we should design this feature in such a way that they do not conflict, but help eachother.

And last: We should also get his trough a team of usability people, before we get any code committed.
---
if you dont like the choices being made for you, you should start making your own.
---
[Bèr Kessels | Drupal services www.webschuur.com]

Dublin Drupaller’s picture

Hiya Bèr,

Thanks for chipping in...it's a little early to start reviewing..I have found one or two minor glitches I'm trying to work through at the moment.

After it's glitch free, I'll comment up the new additions in the file and then start looking at adding in your idea of chaning the {n} tags to something else.

re: theming. I agree about the power of phptemplating,but, what I like about the flexiMax patch is that it is engine independent and extremely simple for newbies and non-coders to get to grips with.

On that subject, with the goal of making it a piece of cake for newbies and designers to get their teeth into flexinodes without having to get into coding, it might make sense to use the profile field name as determined by the user when setting up the content type as the tags. i.e. {field name} instead of {n} where n=number.

That might be more intuitive. While at the same time, experienced phptemplaters can still get stuck into coding at a deeper level if needs be.

I agree about getting this through a team of people using it, before submitting the patch. That's the point of this thread and already I have had back great feedback and pointers to minor/major glitches which I'm doing my best to work through.

Quick question: I'm trying to work out how to hide the fleximax teaser and node textareas when ADDING A NEW CONTENT TYPE. they are unnecessary at that stage. here's a screen shot

Do you know what IF argument i should put in before creating the forms?

UPDATED: Disgregard that question..got it sorted by checking to see if the content name was set before displaying the fleximax layout textareas.

cheers

dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

> Quick question: I'm trying to work out how to hide the fleximax teaser
> and node textareas when ADDING A NEW CONTENT TYPE.

Forgive are my haste is it is necessary to correct

I understand that means if (!$ctype->fields) :) , but obviously that it can be used so:
fleximax.module patch:

@@ -909,7 +909,8 @@
$form .= form_textfield(t('Description'), 'description', $edit['description'], 60, 128, t('A one-line description of the content type.'));
$form .= '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
';
unset($fleximax_t_f);$fd=0;
- if (!$ctype->fields) $ctype->fields=array();
+ if ($ctype->fields){
foreach ($ctype->fields as $field) {$fd++;
if ($field->show_teaser) {
$form .= t('ID='.$field->field_id.' '.$field->label) . ' (' . l(t('edit field'), 'admin/node/types/edit_field/' . $field->field_id) . ')
';
@@ -939,6 +940,7 @@
}
$form .= form_textarea(t('fleximax node'), 'fleximax_node', $edit['fleximax_node'], 60, 5, t('Insert your custom HTML layout using the tags displayed.
This text area controls how your flexinode NODES will be displayed')).'';
$form .= '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
';
+}
$form .= form_textarea(t('Help text'), 'help', $edit['help'], 60, 5, t('Instructions to present to the user when adding new content of this type.'));

$form .= form_submit(t('Submit'));

All should be simple - I too against ID-s but here they by the way
I thought about it still for a long time, - to make all in files-themplates like .theme more correctly, But then their fast creation-change It is complicated

Dublin Drupaller’s picture

Hi Kiev..

Thanks but, I've already sorted the "don't display the forms when adding a new content type". I simply added in a quick check to see if any fields had been set before creating the textareas.

By the way..I recommend you have a look at the latest version in the sanbox the code for creating the forms has changed and I'm using the drupal way now. The code you pasted in the post is not being used now.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

if ($ctype->fields){ - One and the same only it is more complex, this all is not so important, It is necessary to complete flexinode table - the filter and a pattern - I already to a kind that it really is necessary
http://drupal.org/node/30376/52116

adrian’s picture

Or just a generic way to get any template out of the database.

Note: phptemplate already introduced node-flexinode-.tpl.php files.

And having a filter which translates [] format into php to store in the database is incredibly simple.

There is actually a module based on something like this already called Macrotags.

--
The future is so Bryght, I have to wear shades.

Dublin Drupaller’s picture

Will check out the macrotags Adrian. Thanks

I'm aware of the phptemplate node-flexinode-tpl.php files and they are great...but, just to be clear..the idea behind flexiMAX is to allow simple but complete layout control for users without having to get into php coding - which is required with node-flexinode.tpl.php files.

For a lot of designers, using FTP or uploading/downloading files and getting into coding PHP can be a bit off putting. I use override tpl.php files myself..but I had to go through a fairly significant learning curve just to get to that point. Valuable time that could have been spent improving the sites, instead.

theming flexinodes is a common question on here and when I came across Kiev1s code, I thought it was worthy of looking into deeper to help improve flexinode and make it's functionality more accessible to users who don't have time or simply don't have the interest in learning about php.

hope that makes sense Adrian. Appreciate the heads up on the macrotags module. i remember seeing it before, but, thought it was some sort of BBCODE alternative.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Dublin Drupaller’s picture

Hi Adrian,

I had a quick look at the macrotags module and it's not really the same as the FlexiMAX module patch.

Macrotags is like having site-wide BB codes...where you can setup your own tags to insert into content...e.g.

macrotag example
------------------
[link|URL|link text(optional)]
Description:
  Creates a hyperlink.
Example:
  [link|http://google.com|Search Google] => <a href="http://google.com">Search Google</a>

FlexiMAX is about theming flexinode content...i.e. controlling the layout of the content as opposed to inserting customised codes into the content.

I hope that makes sense.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

havahula’s picture

Dublin - thanks for working on this and thanks to Kiev1 for starting it.

I just installed Drupal after growing tired of constantly working on my own cms instead of producing content. That said, I don't fully appreciate the 'rules of the code' just yet.

my question: is it really necessary to wrap the 'raw' content in a div at all? I was hoping to put my flexifields into an unordered list and float them into a sentence but it seems that what comes encased in the {n} is:

<div class="flexinode-textfield-1"><div class="form-item"> $content </div></div>

Perhaps I'm missing something but is there any way to not have the content be limited to a block level element?

Thanks again!

es mus sein

kiev1.org’s picture

My idea - to transfer styles fields from code to a pattern and in a pattern them to change - It is a few infringement drupal way but like so is easier ... to overcome disagreements of browsers and to reduce repeated div-s

Dublin Drupaller’s picture

Hi fhamilton..

great idea and I was just looking at that and I'm checking to see if the output from the flexinode.module can be just what is specified in the flexiMAX text areas.

i.e. the user clicks on a check box to over-ride the default flexinode settings..and the layout specified is the layout delivered...if that makes sense..without all the automatic DIV style wrapping that flexinode pumps out as default.

I'm doing my best to go through the code..will drop you a quick message if you have your contact form switched on (go to MY ACCOUNT and check your CONTACT tab), when I have sussed a clean way of doing it.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

havahula’s picture

Great! if I can be of any help (again, I just got into drupal this week!) let me know. My contact form is on.

UPDATED: It just occurred to me... the reason I was also thinking about this is that down the line I would like to be able to write for myself (or as an additional module) a way to tally the information from some of the fields. For example, I'm creating a running journal with flexinode and one of the fields is "miles run" so I can write a query that sums that field over time so I can track how many miles I've run.

I am not suggesting that you tackle this now or at all. But that's just what I was thinking. I think that down the line the flexinode will have to become part of the default installation in drupal so that all nodes can be flexible...

es mus sein

Dublin Drupaller’s picture

there's other initiatives such as the content construction kit that may incorporate that sort of functionality...if not, it maybe appropriate to suggest it now.

At the moment I'm just concentrating on getting the simple "theming at $content level" feature sorted with the fleximax.patch so it's more accessible to non-coders and designers who get put off by the coding requirements of creating template overrides.

It's relatively simple to create overrides..but, I think it's a better asset for drupal overall if this sort of capability is within reach of more people.

Incidentally...for the specific journal thing you mentioned, where you could create a sortable table of journal entries based on a $flexinode-milesrun field, can I point you to the PHP Sliced Bread Snippets handbook page? If you're not averse to copying and pasting some code and changing one or two lines it would be relatively simple to do the following:

(a) create your journal flexinode

(b) create a custom "overview" page by using a php snippet that creates a sortable and paged (i.e. next page, previous page etc.) table index of your flexinode-journal entries.

There are instructions on how to use the php snippets and there are examples of how to apply/use them in drupal pages and how to change the node-type you want to reference or manipulate.

hope that makes sense...I'm still getting my head around how to strip out the default flexinode DIV wrappers...and the merits/pitfalls of doing it. I think it's good to have the choice, though. Thanks for suggesting it.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

havahula’s picture

Dub, thanks for the Snippets link!

Not opposed at all to copying and pasting code - I assumed I would be writing it from scratch but being late to the game has the advantage of finding a lot of work already done.

I love this cms.

best to you. thanks.

es mus sein

Dublin Drupaller’s picture

Hi Fhamilton,

I have had a deeper look at your request..i.e. strip out the default DIVs and classes that flexinode outputs. It's a little tricky, but do-able.

Here's my 2 cents:

  1. It's easy to put in a checkbox underneath the FlexiMAX layout textareas that says "Override fleninodes default theming" for a node or teaser, but, the way Flexinode works, the theming is done via include files, so it means patching most of those files to clean up the output. (Those include files are important for other reasons besides theming, so it's not as simple as disabling them if the user wants).
  2. I can see the logic of having every field wrapped in it's own unique DIV and CLASS. It is useful to be able to just use .CSS to control how each field looks. At the same time, I can also see the logic of allowing total control for the user in a simple way.
  3. In terms of making flexinode theming more intuitive it would be great if a user could choose to strip out those extra DIV and classes and add in their own. It keeps the pages and style sheet .CSS file tidier and lighter. Especially if the same styles are used across different flexinodes.

I'm busy this week so I'll only be able to jump in and out of the flexiMax patch so I will give it more thought. It's important to keep the patch as simple as possible and unless someone else can see a simpler way of doing it in the code, stripping out the default DIVs and Classes requires patching a lot of files.

I think it's worth looking into deeper and if anyone else has any spare time, please have a look at the latest version of the flexiMAX.module in the sandbox to see if I have overlooked a simpler way of overriding the default flexinode output.

As a reminder...flexinode automatically wraps every flexinode field in unique DIVs and classes for each field.

<div class="flexinode-type-n"><div class="form-item">
flexinode field content
</div></div>

The objective is to offer users the option to override that so they can insert their own when defining their flexiMAX layouts.

Hope that makes sense..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

szczym’s picture

Yester night i have spend on traing to theme the flexinode and it gave a hadeke - im not too good in progaming.

And today boom - the perfect patch is incomming ;)

Thanx a lote folks for your code !

---
Obin.org - Independent media workshop.

Dublin Drupaller’s picture

Hi szczym,

if you get a chance, can you install the fleximax.module on a test site if you have one?

the reason is that we're trying to get a few people to use it and suggest changes before it is formerly submitted as a patch.

You can get the latest version (for Drupal 4.6.x) in my sandbox. Simple to follow instructions on how to install it are given.

If you don't have the time nor a test site to try it out with, no worries. Quite a few drupallers have already tried it and are coming back with suggestions/tweaks. The more the merrier as they say.

Cheers

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

webwright’s picture

Hey all-

Currently testing at:

http://craftydev.dreamhosters.com/?q=node/2

-- I'll keep testing as new stuff happens

for http://www.craftytraveler.com

I'm all in favor of the DIV tags being included in the text areas. That gives people a TON of flexibility to do things like include flexinode values directly in JavaScript (in my case, LAT/LONG would be killer)....

Thanks mucho for workring on this stuff!

Regards,
-t

Dublin Drupaller’s picture

Hiya -t..

just a quick one to let you know that the first link in your post is crashing my internet explorer..do you have something in the node that could be doing that?

http://craftydev.dreamhosters.com/?q=node/2

Just thought I'd flag it..I'm using Internet explorer 6.0..works fine and looks great in Firefox..but there's something in your page that is crashing IE. Is it the map maybe?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

webwright’s picture

Wow-- I created a page that can consistently crash IE. ;-)

All it is is a page with a Google map on it... Works on Firefox-- but I suppose I shall have to figure out why it's crashing IE and fix it, eh?

Thanks for the heads up!

___________________________________--
Tony Wright
Travel Guides (Drupal Site)
Google Adsense Keywords

Dublin Drupaller’s picture

Hi Tony..

I just tried it again in IE (just to be sure to be sure and not sending you off on a goosechase in the wild!)..

that specific link you posted crashes my IE browser window...pop WARNING dialog box opens up and says Internet Explorer could not open the page at [link].

Hope that helps..have a look to see if the map or whatever comes with it needs a specific browser/plugin or other.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

webwright’s picture

Found out the issue was related to the Google Maps API JavaScript inside the body tag. Goddamn IE. I've got a workaround I'll implement tomorrow.

Any progress on having the output be DIV free?

___________________________________--
Tony Wright
Travel Guides (Drupal Site)
Google Adsense Keywords

Dublin Drupaller’s picture

Hi Tony,

I'm only able to catch a few hours at night and at weekends to work out how to get the fleximax layout DIV free..

Progress is slow, but, it's worth it in the long run.

Will post up here as soon as I have worked out, it may require patching the INC files that come with flexinode.module, a situation I'm trying to avoid.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

havahula’s picture

Dub,

thanks for combing through this. I just dove into the contributors manual to get up to speed with coding modules. I'm not sure if I'll be of much help in the short-term but I'll give it a try.

Can you help me understand why the unique DIVs were implemented in the first place?

UPDATED: Dub, you answered that in point 2, strike the question and redirect it: why not have the default DIVs simply show up in the fleximax display field and have the curly braces refer simply to the raw data. That way everyone sees the code and can choose to modify it or not. If someone makes a change that doesn't work then there could be a 'restore default' button on the flexinode that will reset the original DIVs in place.

Aside from that I did want to note that the text area output automatically gets wrapped in an anchor tag for the teaser so that the entire text is hyperlinked. Didn't think this was intentional...

UPDATED: Dub, I think I may be finding my way around the Drupal code. I fixed the textarea hyperlinking in the teaser simply by commenting out the code on lines 719,720,721 and 723.

Was this helpful or misguided?

es mus sein

Dublin Drupaller’s picture

Thanks for that fhamilton..the idea of including the default DIV wrapping is inspired.. nice one. I'll see if I can work that out.

As for the second point..I'm not sure what you mean...

When I'm looking at the teaser...only the title tag is wrapped in a hyperlink..as it should be. none of the text areas in the teaser are linked.

Can you elaborate and indicate which module did you comment lines out of to get rid of hyperlinking - was that the fleixmax.module?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

havahula’s picture

Dub,

the lines I commented out were for the fleximax.module file.

[URL removed by moderator per poster's request -- kbahey]

Dublin Drupaller’s picture

HI fhamilton..

It's a strange one that, it's inserting <a href="/?q=link_to_full_node&amp;#"> after the flexinode/fleximax tags and before your text.

are you using the latest version of fleximax.module?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

havahula’s picture

i double-checked but that's what i'm using. weird isn't it. you're not getting it on your end?

es mus sein

Dublin Drupaller’s picture

HI fhamilton..

I have recreated the problem you're having fhamilton... duplicate test on a temp test site I am playing with.

am looking into that now to see what is causing it..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

drumdance’s picture

I've been playing with Fleximax for a few days and am impressed. Great work!

But (there's always a "but"), I don't like the way the url type is styled. It automatically generates the <a href="field value here"> code, including the anchor text.

Also, it appears that for this particular field type, it does NOT wrap it in something like a <div class="flexinode-url-XXX"<, so it's impossible even to use output buffering and apply a regular expression function, because there's not reliable way to get a handle on that string.

I would prefer to just get the raw text and enter my own anchor text. E.g.

<a href="/{6"}>Click here</a>

I tried just using a text field for this, but then all the div stuff gets added, which breaks the url.

Is there a way to create custom field types in the source code? Then I could just create a field called "raw text" or something like that and write my own code for rendering it.

drumdance’s picture

I did some hacking and found that it's pretty easy to create a custom type. Here are instructions for anyone who's interested.

  1. Copy the file flexinode/field_textfield.inc to a new file named something like field_rawtext.inc
  2. Open the new file in your text editor
  3. Search and replace "_textfield_" with "_rawtext_" or whatever you want to call your new data type
  4. Find the function function flexinode_field_rawtext_name - it's the first function in the file
  5. Change the return to "return t('raw text field');" without the outer quotes
  6. Find the function theme_flexinode_rawtext
  7. Directly underneath, place "return $value;" without the quotes
  8. Save the file
  9. In the content-type list view, you should now see a link that says "add raw text field"
  10. Add the field like you would any other.

When you display the field in node view, you'll see there are no divs around it, including the form-field div. This because of the change to theme_flexinode_rawtext, which you can obviously modify however you want for styling purposes.

HTH. Good luck!

kiev1.org’s picture

It is necessary to make here that: type of data - the block
we should have an opportunity to place in a content any block registered in system - for example the block of last themes from the related sections or banners or a casual photo from a photo gallery

oziumjinx’s picture

DrumDance,

This hack worked miracles for me. I was trying to accomplish exactly what you solved: turning a flexinode field into a usable URL.

My next task is to take that same flexinode raw text field and use that as the anchor for the title of the node. Im pretty sure this is handled in the node.tpl.php file (actually the flexinode-n-tpl.php file) but Im not quite clear as to the implementation.

Has anyone been succsessful with this?

Technology White Papers

sangamreddi’s picture

I got the fatal error after installing the fleximax module

Fatal error: Cannot redeclare flexinode_field_types() in modules\flexinode\flexinode.module on line 19

I have gone through the installation process in the readme file.

Thanks in advance

Sunny
www.gleez.com

Dublin Drupaller’s picture

HI sunny..

I just downloaded the latest version and it works with 4.6.3 & 4.6.2

Did you have flexinode.module installed?

Which version of drupal (works with 4.6.x) are you trying it with?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sangamreddi’s picture

Hi Dublin

Sorry small mistake - i left a copy of fleximax module in modules directory that caused this problem. now it's working fine.

THANK YOU very much for your assistance.

Sunny
www.gleez.com

Dublin Drupaller’s picture

HI Sunny..

No worries.. Please note that I have fixed an error in the module when textareas are in the teaser...download the latest version (I literally just updated it a few seconds ago).

Cheers

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sangamreddi’s picture

Hi Dub

I will download the latest version.

Once gain thank you

Sunny
www.gleez.com

Dublin Drupaller’s picture

you're welcome Sunny. Hope it proves useful and you have time to drop back with any comments/suggestions/bugs

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sangamreddi’s picture

Hi Dub,

Fantastic work, it's really amazing and worth.

But i have noticed a small error.
In the My workspace table the flexinode is not showing the operations (i;e edit and delete options)

Am i missing something? or is this a bug or error, i haven't noticed it earlier with the old felxinode module.

Sunny
www.gleez.com

Dublin Drupaller’s picture

hi Sunny..

Not sure what you mean about "my workspace", can you elaborate?

Do you mean the admin/node page (Administer -->> Content) ?

In Drupal 4.6.3 the fleximax nodes appear fine in my test install on that page. Try clicking on the TYPE drop down list and see if you're CONTENT TYPE (the name you gave the content type at Administer -->> Content -->> Content Types -->> Add Content Type page) is displayed.

Alternatively click on the RESET button, in case your filter is remembering an old combination of node titles to display on that page.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sangamreddi’s picture

Hi Dub,

I am using workspace module.
it displays the list content created by that particular user.

It shows a table with the list of nodes posted by that user with seven columns namely - type, title, owner, published, modified, replies, operations.

In the operations column we'l be having edit and delete links to that post. so an user can easliy administer his content by editing or deleting his posts.

In that column for the flexinode type i not able to see the edit and delete options.

Plz use the workspace wodule you'll understand better.

Sunny
www.gleez.com

Dublin Drupaller’s picture

Hi Sunny,

I haven't got time at the moment to install the workspace.module and try it out...but I did notice the following Bug report for the workspace.module:

sushiGer - August 21, 2005 - 10:33
Project: Workspace 
Version: 4.6.0 
Component: Code 
Category: bug 
Priority: normal 
Assigned: Unassigned 
Status: active 

Description

Hi!

I'm just useing the workspace module in combination with the flexinode module.
In the workspace overview all nodes, which are flexinodes, don't get the links "edit" and "delete".
So I would say this is a bug or a missing feature!?

http://drupal.org/node/29295

Without downloading it, my guess is that there's a bug in the workspace.module. Will find some time later to download and have a look.

Quick questions..does the workspace.module rely on the nodeperm. module? (i think that's a node permission module, just noticed it in other issues with workspace.module)

DUb

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sangamreddi’s picture

Hi Dub,

Thank you very much for the info.

Sunny
www.gleez.com

kiev1.org’s picture

Probably you meant it:
It concerns updatings when types are created by the old module flexinode, There is such moment - the table of a all html pattern is created only after pressing edit content type and save content type - without it it has is all shablon is empty, it is possible to correct for it certainly but correction considerably, for updating probably it is necessary to make separate function which finds empty patterns and to fill with their values by default, but this probably superfluous.

Dublin Drupaller’s picture

I'm not so sure Kiev. I had a quick look at the workspace.module and if you change the following 2 lines it works.

Change these lines in the workspace.module from this

189      $can_edit = FALSE;
190      $can_delete = FALSE;

to this:

189      $can_edit = TRUE;
190      $can_delete = TRUE;

There is an issue open here about the bug in the workspace.module:

http://drupal.org/node/29295

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

patrickharris’s picture

This is absolutely fantastic! At last it is easy to store and retrieve information in a flexible manner.

Thanks very much, Dub for your work, & for uploading the patch to your sandbox.

Dublin Drupaller’s picture

Hi guys,

...I'm jumping back into the fleximax.module patch this weekend to try and get as much completed as possible.

Thanks for all the feedback and positive comments. Credit really goes to Kiev1.org who came up with the initial patch.

As I see it - and to keep things very simple, if we could adapt the patch in the following way, it's done and dusted..

1. It's actually an advantage for users to have the flexinode style classes named consistently, especially when applying different themes to the same site. So, that stays, albeit cleaned up a little by removing superfluous/unnecessary DIV classes, such as the form-item DIV class, around flexinode fields.

2. Pull in the default flexinode theming and style classes into the FlexiMAX layout boxes. So instead of seeing this:

Flexinode Fields available
---------------------------
ID=4 Postcode (edit field)
ID=8 Website (edit field)
ID=9 Photo (edit field)
ID=12 Genre/demog/notes (edit field)
FlexiMAX layout
----------------
<br>{4}<br>{8}<br>{9}<br>{12}

They see this:

Flexinode Fields available
---------------------------
ID=4 Postcode (edit field)
ID=8 Website (edit field)
ID=9 Photo (edit field)
ID=12 Genre/demog/notes (edit field)
FlexiMAX layout
----------------
<div class="flexinode-body flexinode-1">
<div class="flexinode-textfield-4"><div class="form-item">
{4}
</div></div>
<div class="flexinode-textfield-8"><div class="form-item">
{8}
</div></div>
<div class="flexinode-image-9"><div class="form-item">
{9}
</div></div>
<div class="flexinode-textarea-12"><div class="form-item">
{12}
</div></div>
</div>

The DIV classes illustrated above are actually the default DIV classes flexinode wraps flexinode-fields with at the moment.

If we manage to nail the 2 key things above, I think it's a patch worth submitting and doesn't take away from the Content Construction Kit (CCK) development which is very ambitious and according to some developers, is unlikely to see itself into core until drupal 4.8 or so.

quick question: Do we change the tagging system? Bèr Kessels suggested changing the flexinode field tags to something else.....anyone got any suggestions? I actually like the {n} tags. They're very simple and intuitive.

If anyone has anymore suggestions they would like to make for the FlexiMAX.module patch..please mention them now..I'd like to try and finish this off and submit the patch properly on Monday is possible. I'm hoping that the patch can be kept to a minimum of line changes, although, becaus ethe way Flexinode is setup, I think the final fleximax.module patch will be a few patches on a few files.

Anyway..thanks again to all those who downloaded it to test and report back glitches or glaring errors. Much appreciated.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

The first - it is necessary to issue all the separate module, to change {n} it is not necessary also new concepts (macrolanguage) precisely it is not necessary, tag "{" it is not used in html and consequently I think it it is correct, in any case to replace it very simply - in a code one line to correct on any to whom that will want, the main thing simplicity
Ps. With realization module region in drupal-cvs has understood

1am’s picture

Why not the markup use the markup <?=$n?>, or conversely <?=$postcode?>

It is quite simple markup to remember and quite intuitive to PHP users.

I use far more often then I think I should :)

Adrian Freed’s picture

I will make heavy use of this when the label is available instead (as well as?) of the id. I use flexinodes because I like to evolve the node elements and design after a lot of nodes are created. It is poor GUI design to require the user to reference a new ID of your invention after you have gone to the trouble of requiring them to label the flexinode elements. They can always choose numbers as names if they want that.

Dublin Drupaller’s picture

Hi Adrian

Do you mean instead of this:

Fleximax Fields available
---------------------------
ID=4 Postcode (edit field)
ID=8 Website (edit field)
ID=9 Photo (edit field)
ID=12 Genre/demog/notes (edit field)
FlexiMAX layout
----------------
<br>{4}<br>{8}<br>{9}<br>{12}

The fleximax layout is like this?

Fleximax Fields available
---------------------------
Postcode (edit field)
Website (edit field)
Photo (edit field)
Genre/demog/notes (edit field)
FlexiMAX layout
----------------
<br>{postcode}<br>{Website}<br>{photo}<br>{genre/demog/notes}

I think that makes sense, it is certainly more intuitive than referencing a number, even though people are less likely to spell a number wrong.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Adrian Freed’s picture

It is a bit harder to code, but worth it.

paulr’s picture

What I am trying to do is to alter the view given by ?q=flexinode/table/1 to include the location data connected to my flexinodes by the location.module.

I was hoping, to save me from attempting to fix it myself and the resultant bork up, that fleximax would give me access to the fields stored by the location.module for my flexinodes. I also note that fleximax is only concerned with the teaser and the full node and not with the way the node is presented in the table view. This makes me suspect that the table view is not handled by the flexinode (as patched) module.

Is this outwith the scope of this flexinode patch? Thank you for the work you've put into this, it is handy functionality anyway.

Dublin Drupaller’s picture

You are correct at the moment there is only a teaser & full node flexiMAx layout field. The plan is to include a TABLE layout option, that overrides the default, although, that is going to require a lot more work.

I envisage it happening in stages..i.e. just getting the fleximax.patch submitted first and hopefully applied to the flexinode.module with the teaser/node layout fields soon and then following up with the table layout patch.

hope that makes sense..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

Please help - I add new content type - but it does not appear in the form of checkbox in taxonomy - there where usually page and story ( admin/taxonomy/edit/vocabulary/6 ) - modulew webform behaves precisely, heeelp

Yes! Has found! They have lost somewhere function function webform_node_info () And instead of it there function webform_node_name - And in general for somebody works with drupal-cvs modules flexinode and modules webform? Or it only at me such? Check up my alarm.

It is enough to add in webform.module such lines

 function webform_node_info() {
   return array('webform' => array('name' => t('webform'), 'base' => 'webform'));
 }

and all will work, flexinode is similar

Dublin Drupaller’s picture

Hi Kiev,

Nice one..and well spotted..

As a tip, it might be better if you post stuff like that in the flexinode.module issues/bugs form so other users can see it and the flexinode.module maintainer is aware of it.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

Yes, but no mistakes, it is a help how to pass to Drupal 4.7 - while a code is not frozen it no actually. And then they and know it, by the way still. has forgotten, it is necessary everywhere functions check_output has to be renamed to check_markup

profpek’s picture

Using fleximax and must say its great. Using a table to layout the various ids. Problem i have is if a table cell is say

<tr>
     <td colspan="5">phone:{6}</td>
   </tr>

it is displayed as

phone:

123456

and not phone: 123456

I know I'm missing something easy but cant figure what

thanks

Ric

Dublin Drupaller’s picture

Hi Ric.

Unfortunately flexinode.module hard codes extra DIV classes around each field. The point of fleximax.module is to removed that and give total control to the user..

Have a look at the source HTML of your outputted page and you'll see what I mean..

i.e. those extra DIVS such as the DIV class="form-item" are breaking the layout you're entering.

I was hoping to have the fleximax.module patch ready on monday, but work got in the way so I'm jumping in and out of it this week when I can.

the goal is to override those default and in some cases, unnecessary, extra classes in the fleximax layout box.

hope that makes sense..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

profpek’s picture

and thanks for a great module. Its making things a lot easier

Ric

sethcohn’s picture

See http://drupal.org/node/11008
and http://drupal.org/node/15609
If you implement this fix, fleximax will be even better.

gundalo@hogtownlive.com’s picture

I loaded in your module, and i first want to say thank you.

I have a site that lists local events and their cover charges.
I loaded the module, and i set the templates... but the Cover charges disappeared.

I noticed:
"$3-5" appeared as "-5".
"$5" did not appear.

I went in and changed "$3-5" as "$ 3-5", and adding that space after the $ rendered as "$ 3-5", just like it should.

I assume it is somehow translating "$3" as a PHP variable? I would look into this on my own, but I know my PHP experience ends just before regular expressions.

Just letting you know about the bug.

Thanks for the good work, again.

xeeya’s picture

Finally I got the time to test the expanded flexinode-module ... and i love it! Thanks very, very much. It really makes theming different types of content a lot easier.

Only the DIV-Tags are the only obstacle I see. It`s difficult to make extremly custom themes when the div-tags always appear. When this issue is fixed I the patch is perfect. ^^

julius.juurmaa’s picture

Magnificent extension. But...

I am trying to run FlexiMAX on a clean install of Drupal. When I go to administer > settings > flexinode, it just displays:

warning: array_merge() [function.array-merge]: Argument #2 is not an array in flexinode.module on line 810.
warning: implode() [function.implode]: Bad arguments. in flexinode.module on line 120.
Dublin Drupaller’s picture

Hiya Klmiberann..

Which version of drupal are you running it with?

I just downloaded the latest version of fleximax and installed it with drupal 4.6.3 and it works fine. I wasn't able to recreate the errors you got.

Are you using the CVS version of drupal?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

udare’s picture

The problem is actually in Flexinode. See: http://drupal.org/node/21673

Are you using PHP5? There is an incompatibility with the way arrays work in PHP4 and PHP5.

bobx24’s picture

Hi Dublin,

First, thank for your contribution.

Next, I am looking for a way to insert <object> tag, as an aid to instantiate Laszlo apps (http://www.laszlosystems.com).
The problems I have when trying flexiMax for that matter are :

  1. <object> stuff is filtered out
  2. extra div are appended around fields. The purpose of the fields is just to convay filenames, or attributes such as form width, so even an extra space is too much...

Do you think it's possible to use flexiMax that way or is it asking too much ?
Thank for your support anyway.

Robert

bobx24’s picture

Hi again,

After looking up flexinode a little, a solution to my problem seems to be a flexinode php template (http://drupal.org/node/25055#comment-43801)
Thanks anyway.

Robert

noid’s picture

Hey Dub,

Can fleximax disable the display of specified field labels in teasers -- e.g., the field label "Details" doesn't show anymore in the teaser?

Thanks in advance! :)

Dublin Drupaller’s picture

Hi Noid,

Not at the moment noid.

We're working on overriding all the default field labels that flexinode.module outputs for both teasers and nodes.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

noid’s picture

Thanks for the prompt reply, Dub! Will look forward to that feature. Please alert us if that is already available -- a lot of us flexinode users will be very grateful. :)

Marandb’s picture

Just wanted to say this ROCKS... This has made things possible on my site that were just dreams before.

One question though... I have seen talk about how you guys were going to call the thumbnail --- {3a} or something similar.

How is it done? I cannot find how it is called. Is it possible.
I see that it does come up in the Tabular view. I am looking to place the thumbnail in the preview.

Thanks you,
-- Marand B.

maui1’s picture

I am really loving the simplicity of your fleximax module. One of my needs however is to be able to format the flexinode input form also.

Specifically, I have several drop down menus I would like to arrange in an array/matrix format on the input form with lables and links below each drop down menu within each cell of the matrix.

Do you think this is possible and which script would I need to customize to accomplish this.

Dublin Drupaller’s picture

Hi Maui,

Am busy with other stuff at the moment, but, when I'm jumping back in to work on this I'll add that to the list of things to do.

great idea, btw

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

venkat-rk’s picture

Hello Dub,

Any plans to make this available as a standalone module instead of just a patch?

Dublin Drupaller’s picture

Hi Ramdak,

It's tempting Ramdak, but it will be submitted as a Patch for the flexinode.module when the final edits are made.

I'd prefer to see modules improved rather than forked on drupal.....a good example is the email this page..of which there are 3 or 4 different modules available doing the same thing in slightly different ways.

Which is a real pity. It would be much better if there was just one brilliant emailthispage module with the best of all features in one..rather than 3 or 4 with slight variations.

Worth noting that I'm using the flexinode patch for my PROFILE.MODULE now..i.e. using it to layout my user profile pages in a simpler way.

So there maybe scope to develop a fleximax.module after the flexinode.module patch...i.e.

strip out the hard coded styles/theming created by modules and replace it with onscreen flexiMAX layout control...which puts theming back into the hands of designers and CSS.

I can see php programmers preferring to use phptemplate and tpl.php overrides, but, I can also see designers and non-programmers keen to theme their sites more cleanly and without having to learn php stuff.

As mentioned, the flexiMAX concept is useful for a lot of other modules...such as the IMAGE.MODULE. PROFILE.MODULE, COMMENT.MODULE etc...but, getting to grips with modules that have hard coded styles and theming will take a while and make it worthwhile. At the moment the flexiMAX patch for the flexinode.module doesn't override the "hard coded" theming that the module generates. So there are a lot of unnecessary styles included in the output.

hope that makes sense and answers your question

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

venkat-rk’s picture

Hi Dub,

Sorry for the late response.

I think your reasoning about making fleximax a patch to flexinode.module is very sound. I have also been confused by several modules that seems to duplicate various functions.

You mention that making this patch work for other modules will take time. I suppose you mean that it will work with flexinode.module quite okay?

Also, I assume that using the patch for the user.profile module is more of a custom job- meaning, it doesn't work with user profile out of the box, but those with minimal php skills can make it do so?

While you are making the final edits, please consider showing the user profile in tabs as in http://www.buyblue.org/node/1898/view/summary

I can't code, but I can test your patches, may be help with documentation and also make a small contribution within my capacity, if these would be of help...

Edit: Another thread about flexinode based tabbing

Dublin Drupaller’s picture

Ramdak,

I'm stunned by the way you have done those profiles. Excellent.

To answer your questions:

You mention that making this patch work for other modules will take time. I suppose you mean that it will work with flexinode.module quite okay?

The fleximax.module patch works now as it is out of the box...but is inheriting some flaws in the flexinode.module where some unnecessary styles classes are hard coded. So I'm trying to combine the fleximax.patch with an improvement in the flexinode.module. That's what is taking the time.

The same flexiMAX concept could be used for pretty much anything else on Drupal..including user profiles, comments etc. Once I get over the hump of formally submitting the fleximdax.patch for flexinode, I'll move on to the next stage..albeit very slowly.

Work is the curse of the drupal class.. to paraphrase another irishman..I'm busy with some ther stuff that is delaying progress on this.

Also, I assume that using the patch for the user.profile module is more of a custom job- meaning, it doesn't work with user profile out of the box, but those with minimal php skills can make it do so?

After some rigirous testing it should be simple enough to apply as a patch for someone with rudimentary text editing skills.

Others have suggested creating a flexiMAX.module that would "hook" into modules of choice in a settings page. Not a bad idea. But still something that i'll look into later...taking it step by step.

thanks for the link to those profiles...they are stunning. Very well thought out and very very useful.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

venkat-rk’s picture

I'm stunned by the way you have done those profiles. Excellent.

Hey, Dub. That's not my work at all! That's by the dev team of buyblue. I was just pointing to it. But, it's fascinating, isn't it.

This is how they seem to have done it:

http://drupal.org/node/31695#comment-55749
http://drupal.org/node/32363
http://drupal.org/node/31695#comment-56649

mhutch’s picture

Thanks for the great work; this makes theming flexinode content so much simpler. I was using phptemplate node-flexinode_n.php, and was stuck on getting rid of the field labels without losing input filtering, when I came across this. Can't wait to see it in flexinode proper -- it certainly has my vote!

I just have a couple of ideas for improvements. Is is possible that the way FlexiMAX handle teasers could be made a bit more comprehensive?

Firstly, I'd like to be able to have nodes where the teaser content is the same as the body, and no longer have a "more" link.

Secondly, it would be handly to be able to generate excerpts either automatically or using the <!--break--> syntax. Maybe {n:short} or something? A similar feature could apply to image thumbnails, maybe {n:thumbnail}.

Thanks again!

Michael

red_eye@www.patentlystupid.com’s picture

Any luck with getting the extra div tags removed? I could really use that for my site over at http://www.pcsites.com

Dublin Drupaller’s picture

sorry for the delay..am only able to catch time at weekends and now and again to work on this. Will try and get it nailed soon though.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

red_eye@www.patentlystupid.com’s picture

Trust me I can completely relate. I havent had a single consecutive hour to work on pcsites since I put it back up. We ALL appreciate the work you've done and look forward to future developments.

Thanks!
Richard

greygoo’s picture

FlexiMax looks like the only thing in Drupal that approaches the functionality and easy themability of the wonderful and more flexible PageSetter module in PostNuke (http://www.elfisk.dk and http://www.pagesetter.org).

Any progress on removing or overriding the default DIV tags?

http://www.spaz.org - Semi-Permanent Autonomous Zone

goobermaster’s picture

You have to hack up some more files in your flexinode module.
Each .inc file (for example, field_textfield.inc) has a theme function at the end. Modify it to look like this...

function theme_flexinode_textarea($field_id, $label, $value, $formatted_value) {
  $output = "$formatted_value";
  return $output;
}

Don't forget the ones in the contrib folder.

This destroys the themeablility of the flexinode content. However, if you're using fleximax patch, you're doing this theming on the fly inside drupal anyway.

Cheers!

And great work guys.

ergophobe’s picture

Aside from the <div flexinode_body flexinode_X> tag, you can get rid of all the other ones through themes, which will make it easier for you to update the flexinode module. Not sure how this will work with fleximax, but I will be trying it in the next bit.

See these pages

http://drupal.org/node/11811

http://drupal.org/node/17455

http://drupal.org/node/26398

http://drupal.org/node/25055

Dublin Drupaller’s picture

Hi Rick,

There are a number of ways of getting rid of the hardcoded tags...the key is finding the simplest way of doing it in an easily patchable way.

I'm jumping in and out of the fleximax.module at the moment when I get a few minutes and have noticed that the cck.module is progressing (which is similar to the flexinode.module) and while it's handy enough to go in and manually remove all the hardcoded tags, the next stage is to make it easy for others to apply those changes.

If you stumble across a simple way of achieving this, please post up here.....there are a lot of people out there who would love to use the FlexiMAX.module without the default tags.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

and where take this mythical cck.module? I searched searched and anywhere it have not found, only its descriptions and all:)

Dublin Drupaller’s picture

Hi Kiev,

When working on the fleximax.module patch..a few developers mentioned that while flexinode.module is very good, it needs a lot of work and some felt it was better to start from scratch.

Here's a link to the cck.module status
http://drupal.org/cck-status

Here's a link to the prototype version:
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/cck/

CCK is short for Content Construction Kit.

I have been looking at the flexiMAX patch this morning to try and sort the easy removal of the hard coded style tags and I think it's still worth doing, regardless of what's happening with the cck.module.

Based on what the developers mentioned to me, it seems flexinode.module will be superceded by the cck.module.

Hope that helps

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

ergophobe’s picture

Dub, I think it's better to leave them for now because of the patching issue.

First, I should be clear that I'm only referring to the public side, not the admin side. And the threads I mention above for use with flexinode, work just fine with the fleximax patch as it turns out. There's really no difference when it comes to theming in that regard since fleximax and themes apply their formatting sequentially and it all works out just fine.

I'm using my theme to get rid of all tags created in the /modules/flexinode/field_*.inc, overriding them in the themes/themename/flexinode_*.tpl.php files. This of course locks you into one theme, otherwise the tags come back.

For the time being, I'm leaving the tags that are created in flexinode.module until I decide exactly how I want to do things.

This is only one div
<div class="flexinode-body flexinode-X">

I don't mind having that one and you need to provide some sort of default. I suppose you could remove it and provide a default as you do with the <br /> tags, but I do think that the node itself *should* be automatically wrapped in a <div>

All the other div tags are handled through theming or the fleximax template. The reason I'm doing this is because I have many similar fields and I want to be able to reuse CSS classes, instead of having to have a huge number of

div.flexinode-1 div.flexinode-textfield-1 {font-weight: bold;}
div.flexinode-1 div.flexinode-textfield-2 {font-weight: bold;}

and so on and so on.

With the themes I can build in logic like

$shorts = array(1, 2, 5, 6);

$class = (in_array($field->field_id, $shorts)) ? 'short' : 'long';

It's still a bit cumbersome, but it works with or without the fleximax patch and has minimal impact on the module code.

Dublin Drupaller’s picture

I understand what you're saying, but from a theming point of view, I think it's better if we go the extra yard to remove them.

It's cleaner, tidier and easier to manage the style sheets.

Just to be clear, the hard coded tags I'm referring to are as follows...it's not the tag that Wraps the entire flexinode:

With a FlexiMAX layout set as follows
----------------
<br>{4}<br>{8}<br>{9}<br>{12}

Drupal outputs this:

Output
----------------
<div class="flexinode-body flexinode-1">
<div class="flexinode-textfield-4"><div class="form-item">
<br>{4}<br>
</div></div>
<div class="flexinode-textfield-8"><div class="form-item">
<br>{8}<br>
</div></div>
<div class="flexinode-image-9"><div class="form-item">
<br>{9}<br>
</div></div>
<div class="flexinode-textarea-12"><div class="form-item">
<br>{12}
</div></div>
</div>

It's those extra tags that I wanted to get rid of...

Am I right in thinking they can create headaches when trying to control how the fields are displayed in the style.css file?

e.g. the form-item div could break a specific layout...and changing form-item will have a domino effect everywhere else form-item DIVs appear..unless you add in extra style definitions.

I like the idea of the override-default-styling checkbox you mentioned in another post.

Although, if you think it's over-cooking it a bit, please let me know.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

ergophobe’s picture

One thing that I think would make it super simple to maintain and also easy to install would be this: with the fleximax patch, distribute a distro template.php file and the needed includes (phptemplate). It means maintaining a set for each engine, but for those without a template.php file (phptemplate) it would be virtually plug and play. For those who have already built a template.php file, it's a simple cut and paste.

I'd be happy to contribute my phptemplate files if that helps, but I haven't looked into how to do it in any other engine.

Otherwise, it's a pretty simple patch to just knock them out of the field_*.inc files.

Theming effectively does the same thing, but removes the need to actually patch those files. Still, it's only one line in each file, so your patch for a given file would just look like.

Left file: /modules/flexinode/field_textfield_no_div.inc
Right file: /modules/flexinode/field_textfield.inc
55,56c56,58
< return $formatted_value;
---
> $output = theme('form_element', $label, $formatted_value);
> $output = '

'. $output .'

';
> return $output;

There's just a small handful of files, so the total patch wouldn't be that large, but it would mean maintaining all files in the module, instead of just one.

I actually don't like the idea of getting rid of the flexinode-body div. It's already wrapped immediately in the content div, but I like being able to use it for the CSS cascade, so I would always leave it. I just threw out my idea as one way of doing it, but in all honesty, I think it's better to save it, because it makes it simpler to override some style for just a given flexinode, and I don't want to give that up.

ergophobe’s picture

If you stumble across a simple way of achieving this, please post up here.....there are a lot of people out there who would love to use the FlexiMAX.module without the default tags

I think you *need* to have a default div for wrapping the entire node.

The other ones are simple to eliminate using the methods in the threads I cited above, with the drawback that the overrides are only for a given theme or, at most, a given them engine. Personally, since I don't plan to ever offer multiple themes to users, this doesn't bother me. Also, to get rid of them from fleximax means

- either overwriting pretty much every flexinode file with your patch, Not that bad, but people might find it a bit harder to implement and it starts looking more and more like a fork, which you say you want to avoid

- or parsing the output yet again, which I think should be avoided. If you took that approach, I think you would want to start breaking the fleximax code out into functions where possible so that the core flexinode.module would have as few inline changes as possible.

Personally, I'll stick with getting rid of the divs via themes.

If you want to get rid of every last div created by the module, including the one created in flexinode.module in flexinode_content(), I think that in admin you need a checkbox above the teaser and node template input areas that asks something like "wrap with default DIV (leave checked if you aren't sure)?"

So that value of var $fleximax_wrap and is true when checked (default).

Then in flexinode_content()

$node->body = (empty($fleximax_wrap)) ? '' : '

ctype_id .'">';
$node->teaser = (empty($fleximax_wrap)) ? '' : '
ctype_id .'">';

$node->body .= (empty($fleximax_wrap)) ? '' : '

';
$node->teaser .= (empty($fleximax_wrap)) ? '' : '

';

That would work and it would patch fairly nicely.

The $fleximax_wrap variable could be a new field in the flexinode_type table, say "fleximax_wrap" which becomes automatically available as $ctype->fleximax_wrap, just like you grab $ctype->fleximax_t

kiev1.org’s picture

> wonderful and more flexible PageSetter module
Certainly! It reflected as replacement for module PostNuke - PagEd http://paged.anubix.net (module for PostNuke)
I so have made for a field image 2 automatic resize for images (thumb and max) which have not entered into a patch

jiggonaut’s picture

How is that possible? I have already applied this patch http://drupal.org/node/22788 to filter.module but it doesn't work.
The --break-- cannot be executed.
For any hint I would be very happy.

Dublin Drupaller’s picture

I found it easier to have a seperate "teaser" field setup. is that an option?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

jiggonaut’s picture

the result is the same. But think of the case where visitors create the nodes- that's not very comfortable. I 've found this patch for flexinode: (flexinode_truncate2_2.patch) http://drupal.org/node/24500
But I saw that you use other variables.

ergophobe’s picture

Berfore that I was using the excerpt module, which is fine, but the fleximax teaser formatting saves me a fair bit of work. Of course, I'm not allowing general visitors to create nodes, so my situation is a bit different than jiggonaut's

I was on the fence between plain flexinode with theme-based overrides and the excerpt module, verus fleximax with theme-based overrides and no excerpt module. I tried them both and messed around quite a bit with each. I found that the combo of fleximax and themes lets me achieve the desired result with no hacking of the core and just theme-based overrides to get rid of the flexinode div tags.

Get rid of teaser formatting and I'll be back to hacking the distro, which just makes upgrading a hassle.

There is a need for some minor code cleanup in fleximax, but overall I think it offers perfect functionality for my purposes and actually would hate to lose any of its features/functionality.

If it took the --break-- into account too, though, that would surely be a plus.

Dublin Drupaller’s picture

Hi Rick,

Appreciate the feedback..nice one.

Just out of curiosity..did you use the default hard coded style classes or did you prefer to use your own?

I don't like the hard coded (and un necessary) DIV tags that flexinode.module outputs (and therefore flexiMAX.module)...so on the things to do list was to remove those.

I too played around with the excerpt.module as well because most normal users wouldn't know or remember how to use that --BREAK-- thing...so the fleximax.module was perfect as a substitute for both excerpt.module and having to explain how the --BREAK-- thing works and remind them on an ongoing basis..

I agree with your "code clean up" comment with fleximax.module - can you be more specific with what you would like to see cleaned up?

Thanks again for the feedback...I'm up to my eyes at the moment buit am keeping an eye on when Drupal 4.7. is being unleashed to ensure the flexiMAX.module is updated.

there appears to be quite a lot of people using it.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

ergophobe’s picture

I answered as well as I could in my posts on Oct 30 WRT the div thing. Search this thread on my name.

As for the cleanup, really minor stuff in the flexinode_content function
- testing for isset() and empty() instead of !
- all conditionals use curly braces even if one-line (as per the drupal coding standards
- tried to stick to the same tests as flexinode (there's one place where you test a negative when distro tests a postive and I wanted to keep the logic flow as similar as possible for easier patching.

I also added comments whereever fleximax makes a change, using comments

//FLEXIMAX HACK

because I just find that makes it easier to merge with updates.

Totally minor little things. I was going to paste in my flexinode_content() function but drupal absolutely forbids it ("request terminated.. suspicious input")

I can't figure out how to post code on this forum

Steve Dondley’s picture

I'm with jiggonaut. Creating teasers is a job for editors, not users. Users will just get confused by a "teaser" field. I'd much prefer it if the <!--break--> tag could be used and put in there real quick by an editor.

--
Get better help from Drupal's forums and read this.

ergophobe’s picture

I guess you could set up some sort of access system, where you could select which roles can edit the teaser directly and which ones can't.

NaX’s picture

Is it possable to add the taxonomy terms to the theming of the node. I have allocated a vocabulary to my flexinode type and I want to have the term to be displayed on the node.

NaX’s picture

And what about links. Fleximax still seems to use node.tpl.php for the theming of the title and links and terms. What if I want a term to come up in the node content. The only way I can see this being done is creating a duplicate dropdown field for the that content type and what if I want the Read more link to appear near the title for that content type.

Some of this can be done using the node-flexinode-n.tpl.php (the old way) file but then I seem to loose the ability to theme the teaser differently using fleximax.

I think, if fleximax is going to take over theming of nodes and teasers then it must take over all the theming functions that tpl files give. In this way you would improve flexibility and truly be Flexible Node types to the Max. That way if you want you could have your read more link in-between flexinode fields.

netceo’s picture

I'm trying to install this module but somehow not able to get the extra two fields to format the flexinode(on edit content type). It is showing just like it was before i copied fleximax.module to module/flexinode directory.

Don't know what i'm missing out here..

Ran the Mysql script,
Took off the flexinode.module file from modules/flexinode directory
copied fleximax.module file to module/flexinode directory

also tried renaming fleximax.module to flexinode.module..

Can you please help???

NaX’s picture

The node-flexinode-n.tpl.php files are still used. Remove them and see what happens.

The $content var is what is used by fleximax. You can still use your flexinode tpl files but it needs to have the $content var.

eg.
print $content

netceo’s picture

There's no theming file currently installed.. DO i have to rename the file fleximax.module to flexinode.module??

NaX’s picture

you need to overwrite the flexinode.module file with fleximax.module. so that in the end the fleximax.module file is now running as your flexinode.module file with the file name of flexinode.module.

Then remember to enable the module and then refresh the page when viewing the settings page for that content type.

eg. http://yourstie.com/admin/node/types/edit_type/1
1 being the content type ID.

netceo’s picture

I tried doing that a couple of times too.. de-selecting the flexinode module and then selecting it again.. doesn't work. tried adding another flexinode type just to make sure it might not be working with my existing created flexinode but no use..

site is hosted at http://trustsquare-com. livepunjab.com
please delete the space between the . and live to reach the site. i am getting the site ready on subdomain before i upload so dont want the bots around.

regards,

Sham

NaX’s picture

What version of drupal are using. I got it working on 4.6.3.

Dublin Drupaller’s picture

Which version of Drupal are you using?

The fleximax.module has been tested and works fine with Drupal 4.6.x

It won't work with Drupal 4.5.x or Drupal cvs

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

netceo’s picture

This time i deleted and copied the file, and then enabled the module again it worked.. i might have been doing something wrong...

thanks a lot.. Thanks Dub.. i tried to mail you too but it bounced back..

Dublin Drupaller’s picture

Hi Netceo,

glad to hear you got it sorted..

By the way..I just tried to send myself an email using the drupal.org contact form and it worked fine...

I notice your contact form is switched off..perhaps that doesn't allow you to send emails. It shouldn't make a difference. But, maybe if you switched on your contact form that might allow you to send one..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

netceo’s picture

is it possible to have php code in fleximax.

I have an extra variable $node->overall_graph which i need to print in the teaser. Can you please help me accomplish this?

NetCEO

Mad Maks’s picture

What are the plans to get this working with Drupal cvs. I am building a new site and i am using the cvs version in preparation of 4.7 and this module is doing what i am looking for (i think/hope).

If you need help, send me a mail.

MM

kiev1.org’s picture

It is time to migrate on Drupal-4.7

http://Kiev1.org/tmp_download/FlexiMAX-4.7.zip

Mad Maks’s picture

i tried your zip. on a site with flexinode. The updatescript does not update the flexinnode table so fleximax is not working. i had to add the two fleximax fields by hand.

Now i use a custom node-flexinode-1.tpl.php for showing the content. If i remove that and use fleximax i can not use html codes etc. Also a line like:

This is made by {3}, translated by {4}

is not on one line in fleximax but show like this:

This is made by

{3}

,

translated by

{4}

(the numbers are indeed the fields of flexinodes)

what do i do wrong

kiev1.org’s picture

Probably to clear the table cache?

Mad Maks’s picture

what has a linebreak todo with the cache? i ment the layout or are you also talking about that?

kiev1.org’s picture

This module works for me ideally, but I always use plain theme (without various theme engines). I use it for the publication of pages with pictures on a site.

Still I have noticed that in Drupal 4.7 some problems updatings can be solved through clearing of the table 'cache'

kiev1.org’s picture

If you have updated Flexinode then necessary to go reference for example such admin/node/type/2 and correct fill HTML pattern

Mad Maks’s picture

I have done that but still is every space a line break.

theHawke’s picture

Hi all, instead of sunday 11/20/05, I'd like it to spell out Sunday, November 20. How do I change the code to accomplish this?

NaX’s picture

sami_k’s picture

Well, I have been testing fleximax and am very impressed! The only thing that I think that would push this over the top would be the ability to evaluate php code in the teaser and body through the interface, possibly running the code through the filter system..? But I don't understand the architecture well enough to know whether the ability to eval() php code is even possible? Any thoughts on why or what not?

--
Please read the handbook, search the forums, then ask...
http://drupal.etopian.net (Drupal Support)

NaX’s picture

I could definitely use php with my fleximax.

Dublin Drupaller’s picture

I was actually working at the weekend on that! i.e. adding in a checkbox to allow php embedded in the flexiMAX layouts.

If you have a look at my test Drupal site I was playing around with having a teaser followed by a multi-column text area. By uising a php snippet to automatically split the body text into columns. The multi-column snippet is discussed and pasted here..

I haven't finished testing the new addition to FlexiMAX...but I think we will end up with 2 check boxes on the content type configure page..i.e.

  • Override default hard coded styles/flexinode-n.tpl.php and use my flexiMAX layouts instead
  • Allow for embedded PHP in flexiMAX

doing it that way allows complete freedom for the Drupaller...i.e. they have the option of using tpl.php files (which is quite likely with the phptemplate engine being made standard in Drupal 4.7), using their own flexiMAX defined layouts or the defaults.

There's still a bit of work to be done, though, on stripping out the hard coded style DIVS that flexinode.module puts in there..and I had a quick look at the CCK module (content construction kit) to see how that was progressing. It's looking good, but, I think it will be Drupal 4.8 or Drupal 4.9 before we see that finished.

hope that makes sense..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sami_k’s picture

Awesome! Keep up the great work... This one addition has made my life a zillion times easier. Now I can just imagine the possibilities of devleoping various content-based sites with Drupal!
--
Please read the handbook, search the forums, then ask...
http://drupal.etopian.net (Drupal Support)

kiev1.org’s picture

If we use wisiwig the editor that this addition will spoil it html a code on it it is necessary to add simply in FlexiMAX new type of a text-field (eg. plugin: textfield2) - text multi-collumn the field in which will not be connected the visual editor and in which at sending clause the quantity of columns will be specified

Gernalius’s picture

Someone configuring the flexinodes on a website understands PHP syntax basics. No doubt.

Newbies don't mind seeing $ or [. All is new and strange to them. They do like to see known syntax come back in other places.

Experts don't learn syntax in an area they allready know one. They avoid the new thing. If they can't, they stop programming.

There shouldn't be different syntax for platform, package, module, features or tasks. It is not free sofware spirit. Don't replace standard syntax. Save yourself and us the effort. The result will be more flexible and powerfull.

I just wanted this to be known. Don't know what you made. I'll test the module/patch when it's finished.

Keep sailing on! :)

sami_k’s picture

One other awesome feature I thought of would be the ability to create a block based on flexinode content. So this fleximax block would display content in a block that was defined by the node... Adding an extra text area in the flexinode config that would be interpreted into the block.

--
Please read the handbook, search the forums, then ask...
http://drupal.etopian.net (Drupal Support) | http://www.drupalshowcase.com

Dublin Drupaller’s picture

interesting idea.

I was having a quick look at fleximax for Drupal 4.7 yesterday..will have another look next weekend (I plan to "upgrade" it for Drupal 4.7 then and try and get it into a "patch" format)

It's fairly simple to add a new "flexinode-block-content" field..but, how does it "hook" into the blocks? Do you have an idea of how it could do that?

I assume you mean when a particular fleximax node is being viewed, some content associated with the node is automatically displayed as a block...

Is that right?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

kiev1.org’s picture

blocks from flexiMAX I make with the aid of the altered module taxonomy.dhtml, then I will show, as an example - here is test-site completely on FlexiMAX - http://news.orthodoxy.org.ua/

mkpaul’s picture

Hi,
We are planning to use flexinode module along with epublish for our monthly magazine. But after seeing fleximax and understanding that it eventually will be patched to flexinode, we are confused a bit.

so right now, should I start with flexinode or fleximax?
If fleximax, please give me a link to download.

We are running, drupal 4.6.3

thanks,
Paul

lsoderman’s picture

I've read through all the comments, and while I can determine what my problem is, I have yet to figure out how to fix it.

I am using the Chameleon theme as a base. I only wish to change the look of one particular content type. A sample can be seen at http://www.pophometech.com/node/63

The box on the left is a table. I want it that way so the main text will wrap around it when it is long enough. But the extra tags are causing it to break a bit. For example, lines like the Manufacturer's Suggested Retail Price in the info box should be followed by the price itself. Instead, the div tags are causing it to break to the next line.

I don't want to massively change Drupal, I only want to eliminate the div tags for this particular content type. Since I'm relatively new to Drupal, I'm not sure how to translate the instructions given for PHPTemplate themes to Chameleon (or if I need to). Any help would be great!

Thanks!

Leo

NaX’s picture

Your link comes up Access denied. Rather provided a screenshot, or change your permissions.

lsoderman’s picture

Sorry, my bad. Was still in moderation queue. Should be fine now.

NaX’s picture

Do you know much css. I think you should just float them all left and put <br /> between the fields that you need on the next line.

lsoderman’s picture

Doesn't solve the problem. The issue is that the labels, such as "Product Street Price", end up outside of the DIV tags, and the field is inside. It breaks the layout.

To clarify - the DIV tags are acting like BR tags, causing a new line to be generated. When I tried floating to the left, I either got each word on a new line, or no change.

I'd like to avoid having to write a separate CSS definition for each field.

lsoderman’s picture

Had to lay everything out into its own cell of a table to get things to line up. It doesn't look exactly the way I want it to, but until the div tags can somehow be disabled, it is likely the only solution.

the_other_mac’s picture

...but I'd like to hear opinions anyway :)

Should I use FlexiMax, or stick with Flexinode until 'official' release?

I do know some PHP, and I'm reasonably sure I could use node-flexinode-n.tpl.php to do what I want. But it would probably take me a bit longer, and it's ugly.

On the other hand, if I switch to Fleximax now, it seems like I have to constantly keep up with new developments, at least until it becomes an official module. Plus, I'm on 4.6 and may or may not upgrade to 4.7 in a few months.Am I going to be hit with high maintenance in the short term?

Dublin Drupaller’s picture

The idea behind flexiMAX was to develop a simple patch for flexinode instead of releasing a new module.

Some work still needs to be done to get to that patching stage, such as offering site admins an option to use FlexiMAX layout or revert to default (which allows users using phptemplate based themes to use the node-flexiniode-n.tpl.php files). Also there are some extra inserted DIVS that needs to be removed from the flexinode.module to complete the "total control" of how the content is displayed.

there is a new initiative called the Content Constuction Kit (CKK.MODULE) that is a work in progress and will achieve a similar thing., although that won't be ready for a while, according to the developers.

Hope that makes sense and isn't confusing... Best to stick with flexinode.module for the mo until we find the time to upgrade and formally submit the flexiMAX patch.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

the_other_mac’s picture

Great, that makes sense, thanks.

BTW, patches scare me. Partly because I don't have Linux locally, or on the server where my Drupal installation sits. Applying diffs is a nightmare, although thankfully you seem to provide an entire file.

But it's also a psychological thing. "Plugins" = good, patch = pull-out-the-soldering-iron time...

That's just to say, I hope you release the finished product as a module, whether it's part of Flexinode or an alternative. :-)

Dublin Drupaller’s picture

Yeah. I work with XP and find patching/diff and all that stuff a bit daunting. The sort of thing that gives me a headache.

I'm hoping though, that the FlexiMAX patch (when finished) will be comitted to the flexinode.module so it becomes part of the flexinode.module and keeps everything tidy.

cheers

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Kronix’s picture

First off, thanks to Dub and others for your great work with the FlexiMax patch.

I'm assuming (after several weeks of watching this thread) that the next update to FlexiMax is still some time away. Hence, I'm hoping to get some step-by-step help to remove the offending DIV tags that prevent me from placing my content 'inline' (using the example above somewhere):

Phone: 123-4567

vs.

Phone:
123-4567

Would someone be so kind as to quietly share some details on exactly which .inc files I must alter, and exactly what I'm doing to make the change?

- Kronix

Dublin Drupaller’s picture

Hi Kronix..

(Thanks for the comments.)

try this..I haven't had a chance to go through all the .inc files, but, I'm guessing this style.css hack for your flexinodes might work.

br { display:none; }

It's a temporary hack....it would be ideal just to get rid of all those extra DIVS.

more info: http://drupal.org/node/19973

or maybe this template.php "hack": http://drupal.org/node/33850

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Kronix’s picture

Thanks, Dub. This works sufficient for my purposes. Any chance you could give us a quick 'situation report' on the current status of the patch? Not that I'm trying to hurry you along - I'll patiently wait for the quality finish.

- Kronix

samcohen’s picture

Thanks for the patch. In the node display I noticed that all the labels are gone. Is there a way to put the labels back? I know I can just write them in, but then they will still show up even if a particular field is left blank, where as normally, if text is not entered, the label does not show.

Thanks,
Sam

Dublin Drupaller’s picture

Hi Sam,

Quick one...why don't you type them in?

Flexinode Fields available
---------------------------
ID=4 Postcode (edit field)
ID=8 Website (edit field)
ID=9 Photo (edit field)
ID=12 Genre/demog/notes (edit field)
FlexiMAX layout
----------------
<P>Postcode:{4}<br> 
Website: {8}<br>
Photo: {9}<br>
Genre/Demog/Notes: {12}</p>

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

tcb’s picture

Hi,

first, thank You for your work on this patch. This is just perfect for my purposes. I think many people could use this well :)

How long will we have to wait 'til there will be a version that works right away with drupal 4.7b3 ? Is it even going to be incorporated in the flexinode mudule ? Will there be only versions when theres a 4.7 final ?

Please post.

best wishes

tcb

alexmc’s picture

So what is the status on this. It hasnt changed in CVS for four months....

Does that mean it is stable and ready to use, or has no one had time to brush it up?

Dublin Drupaller’s picture

Hi Alex,

It shouldn't be in CVS. It's a work in progress patch for flexinode. To answer your question. It's stable to use with Drupal 4.6.x and from what I hear cck.module (content construction kit) looks like it will be available for Drupal 4.7 when it is released, which may supersede the flexinode.

If you would like to volunteer to help tidy up the theme issues outlined above with the flexinode.module, feel free. Just post back up here when you've done it.

http://drupal.org/node/30376#comment-64816

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

alexmc’s picture

Hmmm,

So Fleximax is basically working. It seems ok here...

http://www.sfpod.net/
eg
http://www.sfpod.net/?q=node&from=2

I dont understand what the {array} is for and cant find the documentation which tells me what. It didnt work on some pages so I replaced it with my working teaser format of


{1}
{2}
{3}

-----

I am not sure if this is a Fleximax question or a plain CSS question but I am trying to get this restaurant review Fleximax node working...

Restaurant: {2} ({7}/10). {9}.

is supposed to appear as

Restaurant: Burger King (1/10) BK is your usual fast food burger bar.

but instead it appears as

Restaurant:

Burger King

(

1

/10)

BK is your usual fast food burger bar.

Any ideas?

(this last is demonstrated here

http://www.normanhui.com/?q=node/7

alexmc’s picture

OK - I see that the last half of this is probably dealt with by the themes discussion earlier in this thread. I guess I have more studying to do :-)

Dublin Drupaller’s picture

I am not sure if this is a Fleximax question or a plain CSS question but I am trying to get this restaurant review Fleximax node working...

Restaurant: {2} ({7}/10). {9}.

is supposed to appear as

Restaurant: Burger King (1/10) BK is your usual fast food burger bar.

------------------------------------

If your fields are as follows:

{2} = Restaurant name
{7) = rating out of ten
{9} = description

I'd suggest using a simple DIVS and CSS or a standard HTML TABLE such as:

<TABLE WIDTH=100% borderColor="#eaeaea" cellSpacing="1" cellPadding="1" border="1">
<TBODY>
<TR>
<TD>
<P align=center>Restaurant:</P></TD>
<TD>
<P align=center>{2}</P></TD>
<TD>
<P align=center> {7} /10</P></TD>
<TD>
<P align=center>{9}</P></TD></TR>
</tbody>
</table>

I hope that helps.

the flexiMAX layout controls how the teasers and full flexinodes are displayed site-wide. As opposed to using node-flexinode-n.tpl.php layout files which are theme specific.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

stoltoguzzi’s picture

Hi Dub,
I start do learn all this html/css/php stuff, what I understand so far:
- to define a fleximax node uses an own syntax to define how the representation will be.
- this definition is then translated into html-code using the corresponding css-file.
what if I would like to have a node where I have an image on the left side like this:

IIIIIIIII TEXTTEXTTEXTTEXTTEXT
IIIIIIIII TEXTTEXTTEXTTEXTTEXT
IIIIIIIII TEXTTEXTTEXTTEXTTEXT

how this is defined in fleximax?

kind regards
stoltoguzzi

Dublin Drupaller’s picture

Hi Stoltoguzzi (great nickname by the way),

follow these simple steps to create a "news" content type where the full flexinode looks like this:

IIIIIIIII TEXTTEXTTEXTTEXTTEXT
IIIIIIIII TEXTTEXTTEXTTEXTTEXT
IIIIIIIII TEXTTEXTTEXTTEXTTEXT

  1. go to ADMINISTER -> CONTENT -> CONTENT TYPES
  2. click on ADD CONTENT TYPE
  3. call it "news"
  4. for the "news" content type, click ADD IMAGE field and call it "teaserpic". Select the "show in teaser" option before saving the field..
  5. for the "news" content type, click ADD TEXTAREA field and call it "intro". Select the "show in teaser" option before saving the field.
  6. repeat the process for another image field called "photolarge" and another text area called "main body". This time, don't select the "Show in teaser" option.
  7. Click on the EDIT CONTENT TYPE link for the "news" content type
  8. copy the layout snippets below for the teaser and main body
  9. SUBMIT the new flexiMAX layout and go to a "NEWS" fleximax node to see it working.

Teaser snippet

Available fields
---------------------------------
ID=7 intro
ID=5 teaserpic
---------------------------------

<table cellspacing="6"><tr><td valign="top">{5}</td><td valign="top">{7}</td></tr></table>

Main Body Snippet

Available fields
---------------------------------
ID=8 main body
ID=6 photolarge
---------------------------------

<table cellspacing="6"><tr><td valign="top">{6}</td><td valign="top">{8}</td></tr></table>

I hope that helps

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

stoltoguzzi’s picture

ok, it is working, thanks for your help!!

stoltoguzzi

ergophobe’s picture

Is there any way to lock this thread? It's become almost like a support forum unto its own for fleximax and when someone posts anywhere but the very end, it's hard to find.

I like to keep up on questions related to the most excellent fleximax patch, but it's just too hard to find new posts in this gargantuan thread.

A suggestion: if you have a fleximax question that isn't answered here, start a new thread. If someone chastises you for starting a new thread even though this topic exists, blame me. I'll take full responsibility ;-)

Yosemite Explorer - hiking and climbing in Yosemite (drupal)

Dublin Drupaller’s picture

I'm working on a new theme snippets handbook section at the moment Rick and hope to jump back into the fleximax stuff soon. in particular update it for Drupal. 4.7 with the ammendments noted above and that means it will be easier to follow (It's going to be a patch for flexinode 4.7).

As requested, here's a temporary support thread for the fleximax module patch for flexinode.module.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

slayerment’s picture

This along with Flexinode is the best freaking module ever! Thank you very much. This solves tons of problems I've been facing with Drupal :).

slayerment’s picture

I was wondering if there was some type of way to remove these divs from my layout. I have tried looking through all the flexinode files and tweaking them, but can't find where to remove them. Is there any type of way to do this?

Thanks

solipsist’s picture

After installing Fleximax following the instructions to the point I no longer see administer -> content -> content types. I must have done something wrong but I am clueless as to what it might be. Any help is most welcome!

Thanks in advance.

--
Jakob Persson - blog
Leancept – Digital effect and innovation agency

luyendao’s picture

i had no problems installing fleximax - added those two lines of sql to the database, then over-wrote flexinode.module with what was inside fleximax.module and that was it.

It works great, i'm very grateful for the hard work that went into it - especially coming from a non-programmer!

Cosmos-1’s picture

if i do {2}, {3}

in HTML instead of appearing as:

2, 3

it appears as:

2

,

3

why is this?? im very confused.

David Stosik’s picture

'2' and '3' are inside a <div>, and div is an HTML block entity...
Maybe making this div displaying inline (display: inline; in your CSS) could do the trick...

stoltoguzzi’s picture

is there a way to display the node-title of this flexinode in the same way as the flexinode-fields

{$node->title} does not work.

Dublin Drupaller’s picture

hi Stoltoguzzi..

I'm almost certain you can't..it's only the fleximax fields you can insert in your layout textarea.

As an alternative, if u are using a phptemplate based theme, you could create a node-flexinode-n.tpl.php layout file..and then call the $node->title in there.

I've created a handbook section dealing with Customising Flexinode layouts that might be of use.

hope that helps

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

stoltoguzzi’s picture

thanks for the answer, this will help me!

Dublin Drupaller’s picture

Quick tip...

I've used fleximax on the same site as I have used some node-flexinode-n.tpl.php layout overrides.

the node-flexinode.tpl.php layouts automatically override fleximax settings for a particular flexinode type..if that makes sense.

In other words, if you have a lot of content types, but, you want to override 1 using a node-flexinode-n.tpl.php file and use fleximax for the rest..you can.

hope that makes sense

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate