Cofoundry: How do I add a PageBlock inside a PageBlock? - asp.net-mvc

I want to be able to build a site from the design view. Utilising Bootstrap, I want to be able to add rows, add columns to my rows and then add text and images etc. to inside those columns.
I though I could do this by making both "row" and "column" page blocks but if I do this I can't add anything inside the row or column page blocks once they're on the page (as they're not page templates).
The image below shows me adding a Row PageBlock to the introduction section in the Cofoundry CMS BasicTestSite starter theme provided by Cofoundry. But I can only add things below it, not inside it.
I know one option would be to add rows to the PageTemplate, but the limits the CMS to only being able to work with the number of rows on the page template. I want to be able to add rows and columns dynamically without touching code.
PS: I'm new to Cofundry, so apologies if I'm using this terminology incorrectly.

I think you should be able to use Nested Data Models to achevie this, whereby your row data model can have a nested collection of columns. However nested data models aren't associated with a template, and it is up to the container block type to know how to render your model.

Related

ios/xcode/coredata: How to mimic ajax call in objective c

For a tag system, when entering a new item, I'd like the user to start typing a letter or two and see possible tags...similar to how SO tags work on the website i.e. Ajax.
Is there a way to do this on IOS?
Basically the Add Item screen has some empty text fields where you put the name etc.
I'd like to have an additional empty field where as you enter letters you see possible tags appear below and can then select one to tag the item.
The tags would be served from an entity or table so there would have to be a call to core data to supply them based on the letters typed.
Do I have to implement a full blown tableview to do this? Or is there a way to make the possible tags show up below the textfield box.
Thanks for any suggestions.
You could try a third party development in order to make what you want. In a recent project I have used this one:
https://github.com/EddyBorja/MLPAutoCompleteTextField

New List item customisation

I currently have a custom list which contains about 20 columns, however when my user selects new to add in a new item to the list I want to only show 10 of the 20 fields.
The default setting allows me to hide some fields but this option is not what i need as later on in the workflow i require a user to add in data to say items 11-20.
I need a couple of data entry forms
new - show say columns 1-10
update - modify columns 1-10 if required and add data to columns 10-15
authorise - modify columns 1-15 if required and add data to columns 15-20
Ideally each data entry form should have its own workflow but that can come later and is a nice to have
any help please ?
by the way sharepoint designer is not an option for me, I do however have info path available.
If it is a custom list you can define which fields are going to be available on each form using the attributes ShowInDisplayForm, ShowInEditForm and ShowInNewForm.
http://msdn.microsoft.com/en-us/library/aa543225.aspx
I usually use them when im define the content type.
<FieldRef ID="{493AE2E2-DA5D-46C6-93D9-D43F85B03329}" Name="myCustomField" Required="FALSE" ShowInNewForm="TRUE" ShowInEditForm="FALSE"/>
i hope it helps!

Ruby on Rails initial controller setup

I'm getting started with Ruby on Rails and have some questions. I currently have a website that is written in Perl/HTML/Javascript, etc. My goal is to convert this website to use Rails. I'm running into a stubmling block on how to get started.
Here is the general overview of the current website:
The main page has 3 selection lists that get populated on page load (via SQL). The user can select an option from one of these lists (say a date as one of the lists stores dates). Currently, using AJAX, this calls a Perl CGI script which queries the database with the chosen date and returns a table containing the appropriate records (fills in division next to the selection lists).
There are no other pages on the website (besides a changelog) as everything happens on the main page. The selection lists do not get refreshed after each selection due to AJAX.
My question is, would I have a controller called Selection to populate the lists and another called Output to create the table of records? Does that setup makes sense?
Thank you!
This is my understanding about your requirement.
1) You have a page where there are three selection boxes
2) If a user changes any one of the selection box, then you are posting data to backend to get output based on the selection (using Perl CGI script)
The output is loaded after you get response from backend.
If my understanding is right, below are my suggestion.
Suggestion :
You need not to have different controllers for each action, in Rails you may have multiple action within a single controller.
Say you can name your controller and action as below
Selection Controller (Can have multiple actions under it as below, you can define custom names for each action in controller and add routing information in app/config/routes.rb file)
- GenerateList
- CustomAction1
- CustomAction etc.,
EDIT :
You should not use single controller for all your actions in the website, you need to categorize
functionality and create multiple controller/actions accordingly.
Let me know if you face any difficulty in creating and running custom actions.

How to handle front-end content in order to display menu items based on the current user?

I am using Ruby on Rails 3.2.2 and I would like to "handle" / "generate" the proper front-end content so to follow a "common" way of managing menu items mostly based on the current user "equality". That is, I would like to display different menu items based on
the current browsed page;
the current user that is accessing that page (the page could be related to a user that is not the current user).
Where (for example, in controller, view or model files) and how (for example, stating checks related to the current user in controller, view or model files) I should "state" / "put" those "conditional statements"?
At this time I think (mostly for matters relating to the current browsed page) I could handle this matter directly in controllers by using helper methods...
I tend to put this into the View files with simple or static cases coded into the View file and more complex cases which would require more than just one line of coding into the helpers.
But in order not to bloat the view file, I suggest to use partials to offload blocks of code from the view file.
One of the reasons why I use the views is that I will do certain user based formatting anyways, e.g. if I list all the orders, then the normal user will see certain columns displayed, whereas if the admin logs in, he will see a couple of additional columns. This is typically done with something like
<%if #curreny_user_type == 'admin'%><td> ...... </td><%end%>
Thus before I now start splitting up some of the user based logic into the controller and others into the views, I'ld rather have them always at the same place.

Stack Overflow-like tagging behavior in Rails

I have a new application that contains a Modela called "Campaigns". Each campaign is able to have any number of tags associated with it.
What I am attempting to do is impliment a Stack Overflow-like behavior with these tags. Namely, that when you create a new campaign, it gives you a text-field that will auto-complete with tags that already exist, and start anew every time you put a space. Additionally, should the tag not exist, it should create a new tag.
This railscast is a step in the right direction, but it only allows for one "tag" at a time.
Can anyone point me in the right direction?
In the model layer I'd go for a plugin like: https://github.com/mbleigh/acts-as-taggable-on.
In the view you want an autocomplete plugin (personally I use this http://docs.jquery.com/Plugins/autocomplete). Then either generate a controller for the tags and fetch the autocomplete list remotely or just = them in the page.

Resources