[development] minimizing views_default_views in a module
Sean Dague
sean at dague.net
Fri Mar 18 13:54:24 UTC 2011
For instance, I find large duplication of:
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
all throughout the export to be not conducive to maintainability (there
are 12 instances of that stanza, 9 are exactly the same, and the other 3
only vary in their 'text' field).
I find that level of duplication somewhat problematic, and something I
like to avoid.
-Sean
On 03/18/2011 09:31 AM, Carl Wiedemann wrote:
> Not quite sure I understand what exactly is non-maintainable?
>
> You may also investigate http://drupal.org/project/features for
> assistance with exporting Views to code.
>
>
> On Fri, Mar 18, 2011 at 7:45 AM, Sean Dague <sean at dague.net
> <mailto:sean at dague.net>> wrote:
>
> I'm working on a new drupal 6.x module (currently in sandbox
> awaiting review - http://drupal.org/sandbox/sdague/1072704) which
> exports it's data via views. When I implemented
> hook_views_default_views() I just used the export functionality on
> views for a few basic views to get things started.
>
> That works, but those are both very verbose, and don't implement any
> i18n. Is there a standard way of trimming down the default values in
> those views so this becomes a bit more sane and maintainable?
>
> Advice would be appreciated,
>
> -Sean
>
> --
>
> Sean Dague Learn about the Universe with the
> sean at dague dot net Mid-Hudson Astronomical Association
> http://dague.net http://midhudsonastro.org
>
>
--
Sean Dague Learn about the Universe with the
sean at dague dot net Mid-Hudson Astronomical Association
http://dague.net http://midhudsonastro.org
More information about the development
mailing list