Grayside.Org - openatrium http://grayside.org/category/terms/openatrium en Adding a Content Type to the Open Atrium Calendar Views http://grayside.org/2010/09/adding-content-type-open-atrium-calendar-views <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>People often seem to wonder how they can get their new date-specified content types to show up on the Atrium Calendar. The following Views snippet makes it happen for a content type called &#8220;example_type&#8221; in module &#8220;custom&#8221;. Note that this code is specific to the Views as they were renamed for <a href="http://drupal.org/project/kit">Kit</a>-compatibility in Open Atrium 1.0-beta8.</p> <h3>Step 1</h3> <p>Build your &#8220;example_type&#8221; content type. You can build this out however you want, but for the purpose of this post you need to add the same <em>field_date</em> that the Event type uses.</p> <h3>Step 2</h3> <div class="geshifilter"> <div class="php geshifilter-php" style="font-family:monospace;"> <pre style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009933; font-style: italic;">/** &nbsp;* Implementation of hook_views_default_views_alter(). &nbsp;*/</span> <span style="color: #000000; font-weight: bold;">function</span> custom_views_default_views_alter<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$views</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #000088;">$views</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'calendar_listing'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">display</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">display_options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filters'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'example_type'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'example_type'</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #000088;">$views</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'calendar_upcoming'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">display</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">display_options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filters'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'example_type'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'example_type'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></div> </div> <h2>Why Not Override the View with Views <span class="caps">UI</span>?</h2> <p>Once you have overridden the core Views in Atrium, you take a potentially stressful upgrade/maintenance path and make it vaguely nightmarish. Your changes will disappear into the ether when you upgrade. Restoring your changes would require building out a site based on a backup database to grab the key pieces of your override.</p> <p>By keeping these changes in code, you can much more easily determine how to fix them&#8230; assuming any changes are even necessary!</p> <p>Happy calendar&nbsp;hooking.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item odd"><a href="/category/terms/views">views</a></div><div class="field-item even"><a href="/category/terms/calendar">calendar</a></div></div></div> Wed, 08 Sep 2010 23:04:50 +0000 Grayside 89 at http://grayside.org http://grayside.org/2010/09/adding-content-type-open-atrium-calendar-views#comments Adding Items to the Open Atrium Settings Menu http://grayside.org/2010/08/adding-items-open-atrium-settings-menu <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Recently I dusted off <a href="http://drupal.org/project/og_vocab"><span class="caps">OG</span> Vocabularies</a> with an eye toward integration with OpenAtrium. To my mild surprise, there was really not much that needed to be done. The menu path (node/%node/og/vocab) isn&#8217;t great, but that can be tackled later.</p> <p>All I wanted was to avoid another hidden tab that can only be reached by clicking on <strong>Settings &gt; Customize Features</strong>. I wanted the group vocabularies to be accessible directly in the Settings menu.</p> <p>It turns out it&#8217;s really simple. There is a hook.</p> <div class="geshifilter"> <div class="php geshifilter-php" style="font-family:monospace;"> <pre style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009933; font-style: italic;">/** &nbsp;* Implementation of hook_atrium_admin_links_alter(). &nbsp;*/</span> <span style="color: #000000; font-weight: bold;">function</span> custom_atrium_admin_links_alter<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$links</span><span style="color: #339933;">,</span> <span style="color: #000088;">$space</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$space</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'og'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; &nbsp; <span style="color: #000088;">$item</span> <span style="color: #339933;">=</span> menu_get_item<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;node/<span style="color: #006699; font-weight: bold;">{$space-&gt;id}</span>/og/vocab&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'access'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$links</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'og_vocab'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Manage Taxonomy'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'href'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'href'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span></pre></div> </div> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item odd"><a href="/category/terms/interface">interface</a></div></div></div> Tue, 24 Aug 2010 16:55:07 +0000 Grayside 84 at http://grayside.org http://grayside.org/2010/08/adding-items-open-atrium-settings-menu#comments Spaces Integrating a CCK Field http://grayside.org/2010/07/spaces-integrating-cck-field <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>I wanted to make a <span class="caps">CCK</span> Field available only when a given feature was enabled. It turns out it&#8217;s really easy.</p> <p><span class="caps">CCK</span> comes with a <em>hook_field_access()</em> hook (see <a href="http://api.lullabot.com/content_access">content_access()</a>). Any implementation of this function that returns <span class="caps">FALSE</span> for a given field results in that field being denied to the user.</p> <p>By implementing this function with a <a href="http://drupal.org/project/spaces">Spaces</a> <span class="caps">API</span> call instead of the content_permissions module approach of a new, field-specific permission, all kinds of magic becomes possible.</p> <p>Read on for demonstration code.</p> <div class="geshifilter"> <div class="php geshifilter-php" style="font-family:monospace;"> <pre style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009933; font-style: italic;">/** &nbsp;* Implementation of hook_field_access(). &nbsp;* Allow View/Edit access to 'field_my_cck_field' only when 'feature_name' is enabled. &nbsp;*/</span> <span style="color: #000000; font-weight: bold;">function</span> custom_field_access<span style="color: #009900;">&#40;</span><span style="color: #000088;">$op</span><span style="color: #339933;">,</span> <span style="color: #000088;">$field</span><span style="color: #339933;">,</span> <span style="color: #000088;">$account</span><span style="color: #339933;">,</span> <span style="color: #000088;">$node</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;"><span class="caps">NULL</span></span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #666666; font-style: italic;">// Be sure not to affect other fields.</span> &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'field_my_cck_field'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;"><span class="caps">TRUE</span></span><span style="color: #339933;">;</span> &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; &nbsp; <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$op</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'edit'</span><span style="color: #339933;">:</span> &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'view'</span><span style="color: #339933;">:</span> &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Make access contingent on whether a given feature is enabled in the current space, such as atrium_book.</span> &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> spaces_access_feature<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'view'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'feature_name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span></pre></div> </div> <p><strong><span class="caps">EDIT</span>: <a href="http://drupal.org/node/887272">Issue posted</a> to the Spaces queue with patch to add this functionality generically for all&nbsp;fields.</strong></p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/cck">cck</a></div><div class="field-item odd"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item even"><a href="/category/terms/access-control">access control</a></div><div class="field-item odd"><a href="/category/terms/spaces">spaces</a></div></div></div> Mon, 26 Jul 2010 20:25:09 +0000 Grayside 86 at http://grayside.org http://grayside.org/2010/07/spaces-integrating-cck-field#comments Integrating Some Other Feature with Spaces http://grayside.org/2010/07/integrating-some-other-feature-spaces <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>I have found more than once a situation in which I had a basic feature that could be used on any site which I would like to see integrated with Spaces (for OpenAtrium magic). It usually runs like this:</p> <ol> <li>I have the FeatureServer feature.</li> <li>I want it in OpenAtrium.</li> <li>Here&#8217;s a new Feature that provides some Contexts and some Groups variables.</li> <li>Here&#8217;s a patch that you must apply to FeatureServer to make Spaces aware of it. (And other stuff).</li> </ol> <p>&#35;4 is a pain, but I&#8217;ve recently discovered how to shrink it down a little more: hook_system_info_alter().</p> <div class="geshifilter"> <div class="php geshifilter-php" style="font-family:monospace;"> <pre style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009933; font-style: italic;">/** &nbsp;* Implementation of hook_system_info_alter(). &nbsp;*/</span> <span style="color: #000000; font-weight: bold;">function</span> my_atrium_savvy_feature_system_info_alter<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$info</span><span style="color: #339933;">,</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'some_other_feature'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; &nbsp; <span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'spaces'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'types'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'og'</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span></pre></div> </div> <p>This hook is called from <em>features_get_info()</em> in features.module. The hook allows you to changes all the info files settings of a feature. Note: Row is apparently a huge variable to dump to the&nbsp;screen.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item odd"><a href="/category/terms/spaces">spaces</a></div><div class="field-item even"><a href="/category/terms/features">features</a></div></div></div> Fri, 23 Jul 2010 16:10:17 +0000 Grayside 85 at http://grayside.org http://grayside.org/2010/07/integrating-some-other-feature-spaces#comments Integrating the Features Server into OpenAtrium http://grayside.org/2010/06/integrating-features-server-openatrium <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Working on integrating the <a href="http://code.developmentseed.org/featureserver/node/163">Features Server</a> feature into <a href="http://openatrium.com">OpenAtrium</a>. My intention is to set it up as another Casetracker Project type.</p> <p>OpenAtrium provides a solid case tracker and documentation system, and is a natural fit for the infrastructure of a Drupal.Org-style project ecosphere. Integrating them will allow me to post Features I&#8217;ve created to a place where I might actually have a means to get feedback on my work, let alone provide support.</p> <h2>Project Status of <span class="caps">OA</span> Features Server feature</h2> <ul> <li>Features Project as a Casetracker Project <strong>✓</strong></li> <li>Features Project automatically a Notebook <strong>✓</strong> </li> <li>Converting Projects View to a Site/Group feature. [in progress]</li> <li>Trivial Modification of Features Server code to play nice with OpenAtrium and Atrium Casetracker .<strong>✓</strong> [will ship with patch]</li> </ul> <h2>Conundrums</h2> <ul> <li>Features Server feature uses Context 2.0, <span class="caps">OA</span> uses Context 3.0</li> <li>hook_views_default_views_alter() has limited to no best practices or examples I&#8217;ve been able to find, given it&#8217;s currently documented intention as a site-specific hook. Somehow I don&#8217;t think it&#8217;s role will remain in site-customization in the world of&nbsp;Features.</li> </ul> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/taxonomy/term/1">drupal</a></div><div class="field-item odd"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item even"><a href="/category/terms/features-servers">features-servers</a></div></div></div> Thu, 03 Jun 2010 16:32:53 +0000 Grayside 77 at http://grayside.org http://grayside.org/2010/06/integrating-features-server-openatrium#comments OpenAtrium Group Manager as Content Administrator http://grayside.org/2010/05/openatrium-group-manager-content-administrator <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>In Drupal, it only takes a couple hours (or perhaps a couple days) to build the concept of a site-wide content manager into your system. It gets mighty tricky to start parceling out administrative tasks for parts of the site.</p> <p>With Organic Groups (the module behind OpenAtrium&#8217;s groups), the solution to this problem has always been messy. But with the advent of Spaces and Group Administrator configuration, it seems like <span class="caps">OA</span> and related sites are within shouting distance of giving Group Managers the power of Content Administration.</p> <p>Between my <a href="/project/oa-change-group"><span class="caps">OA</span> Change Group</a> and <a href="/project/oa-book-manager"><span class="caps">OA</span> Book Manager</a> modules, I&#8217;ve started experimenting with how to bring that kind of capability to light.</p> <p><span class="caps">OA</span> Change Group adds a new subtab to admin/content/node. That works fine, for site-wide administrators. It also allowed me to punt on the whole notion of double-checking that the logged in user has the right to post content to the destination group. But it doesn&#8217;t help group managers, except to the extent that the site admins are ready and willing to take content management tickets.</p> <p><span class="caps">OA</span> Book Manager takes a cue from the content-management-lite Archive feature in <span class="caps">OA</span>, and slaps a sub-tab into the feature it&#8217;s related to. In this case, adding a &#8220;Manage&#8221; tab to the Notebook feature.</p> <p>But if <span class="caps">OA</span> content management is going to remain a cohesive experience for site administrators and group managers alike, a few more best practices need to be worked out, and <span class="caps">OA</span> needs to come packaged with more of a skeletal administration system in the groups themselves so feature-builders know what to be thinking about in working&nbsp;together.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/taxonomy/term/1">drupal</a></div><div class="field-item odd"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item even"><a href="/category/terms/content-manager">content manager</a></div></div></div> Thu, 06 May 2010 07:38:13 +0000 Grayside 70 at http://grayside.org http://grayside.org/2010/05/openatrium-group-manager-content-administrator#comments Single Group Login Redirect http://grayside.org/2010/04/single-group-login-redirect <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p><a href="http://community.openatrium.com">Community.<span class="caps">OA</span></a> had a <a href="https://community.openatrium.com/issues/node/1805">request</a> for functionality that would redirect a user with a single group membership to that group&#8217;s homepage.</p> <p><a href="http://tinkercms.grayside.org/projects/oa-single-group-login-redirect">I packaged that functionality up as a Feature</a>, so you can use it too. The <em>oa_</em> prefix refers to the support for spaces_og/purl to generate a group&nbsp;<span class="caps">URL</span>.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item odd"><a href="/category/terms/drupal6">drupal6</a></div><div class="field-item even"><a href="/category/terms/organic-groups">organic groups</a></div><div class="field-item odd"><a href="/category/terms/rules">rules</a></div><div class="field-item even"><a href="/category/terms/login">login</a></div></div></div> Wed, 28 Apr 2010 21:39:37 +0000 Grayside 64 at http://grayside.org http://grayside.org/2010/04/single-group-login-redirect#comments Changing Node Group Audience http://grayside.org/2010/04/changing-node-group-audience <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>In OpenAtrium, it&#8217;s not easy to change the group affiliation of a node once it has been created. <span class="caps">OA</span> locks down the interface to set group audience specifically to make the interface easier to understand.</p> <p>I have just posted a quick feature that demonstrates how to grant administrators the ability to shuffle nodes around between groups, it can be found in the <a href="https://community.openatrium.com/issues/node/48#comment-3624">issue queue at community.<span class="caps">OA</span></a>.</p> <p>It introduces two things&#8211;a new Action that toggles the group audience of a given node, and a <a href="http://drupal.org/project/views_bulk_operations">Views Bulk Operations</a> View that allows you to apply that action to batches.</p> <p>There is a special column in the View labeled &#8220;Member of Private Group&#8221;. This column lets the administrator know whether the current group is a private group, meaning the content is almost certainly private as well. Any quality of the group a node starts in will be lost once you move a node to a new group, and that includes whether it is private content. Remember that, and use with care!</p> <p>Note: If you preface the <span class="caps">URL</span> of the View with a group namespace, it will limit the content to the nodes of that group.</p> <p><strong>Download feature from my Features Server&nbsp;<a href="http://tinkercms.grayside.org/projects/atrium-groups-change-node-group">here</a></strong></p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item odd"><a href="/category/terms/views">views</a></div><div class="field-item even"><a href="/category/terms/og">og</a></div><div class="field-item odd"><a href="/category/terms/vbo">vbo</a></div><div class="field-item even"><a href="/category/terms/actions">actions</a></div></div></div> Mon, 12 Apr 2010 18:33:31 +0000 Grayside 62 at http://grayside.org http://grayside.org/2010/04/changing-node-group-audience#comments Spaces Private Content http://grayside.org/spaces-private-content <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>&gt; Replaced with a project on D.O: <a href="http://drupal.org/project/og_privacy"><span class="caps">OG</span>&nbsp;Privacy</a></p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/permissions">permissions</a></div><div class="field-item odd"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item even"><a href="/category/terms/spaces">spaces</a></div><div class="field-item odd"><a href="/category/terms/og">og</a></div></div></div> Wed, 31 Mar 2010 16:35:05 +0000 Grayside 60 at http://grayside.org http://grayside.org/spaces-private-content#comments Simple Spaces Recipe for a Static Welcome Widget http://grayside.org/2010/03/simple-spaces-recipe-static-welcome-widget <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>One of the little conundrums in OpenAtrium (and I imagine in Spaces) is building static content for the space. (Or in OpenAtrium terms, getting a nice dashboard box to stay put, yet be customizable by group.)</p> <p>There are countless ways of doing this, but I opted to create a <span class="caps">CCK</span> Textarea field in my group content type (named <em>field_group_welcome_message</em>) and turn on the <span class="caps">PHP</span> filter.</p> <p>Then I created a <a href="http://drupal.org/project/boxes">Box</a> (which is what OpenAtrium uses, could just as well have been a block) using the following snippet:</p> <div class="geshifilter"> <div class="php geshifilter-php" style="font-family:monospace;"> <pre style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #000088;">$space</span> <span style="color: #339933;">=</span> spaces_get_space<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$space</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">group</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_group_welcome_message</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;"><span class="caps">NULL</span></span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$space</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">group</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_group_welcome_message</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'format'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> check_markup<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;"><span class="caps">TRUE</span></span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$space</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">group</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">og_description</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$text</span><span style="color: #339933;">;</span></pre></div> </div> <p>The bit about <tt>$format</tt> and <tt>check_markup</tt> is only relevant if you turn on input filtering for your textarea. Can&#8217;t figure why you would not do that. <strong><span class="caps">UPDATE</span>: Added a check for a null welcome message. If there is none, the group description will be inserted.</strong></p> <p>Now, whenever anyone goes to edit the group node/group settings, they are also offered the chance to play with the welcome message. You could just as well use this technique to pull out the Body of the group node, if that&#8217;s available. In OpenAtrium it&#8217;s removed, since it doesn&#8217;t fit into the dashboard concept without this kind of magic.</p> <p>You could just as easily build some kind of zany view to achieve the same result, but you&#8217;d still need to do something to mark your target content uniquely. This method seems the most straightforward for the end-user.</p> <p>I will update this another time with information about enabling such a block by&nbsp;default.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Terms:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/terms/openatrium">openatrium</a></div><div class="field-item odd"><a href="/category/terms/spaces">spaces</a></div><div class="field-item even"><a href="/category/terms/dashboard">dashboard</a></div><div class="field-item odd"><a href="/category/terms/boxes">boxes</a></div></div></div> Sun, 07 Mar 2010 08:33:50 +0000 Grayside 58 at http://grayside.org http://grayside.org/2010/03/simple-spaces-recipe-static-welcome-widget#comments