mvc 3 print view or export first - asp.net-mvc-3

I am doing small web app that have list of workers and theirs work hours. So far everything was nice and easy but printing is new to me :). I have made simple view inside that view is my table which is dynamically populated.
I need basically to be able to print that table for each worker, and every worker should be separate table on separate page. So page 1 should be worker 1, page 2 worker 2 and so on. Can someone tell me what is the best way to archive this, some example or tutorial,cause i never did anything that needed to be printed so far in my short programming career :)
Thanks for help.

Im not quite sure I fully understand, but the problem is to achieve tables on seperate pages?
To hide unwanted elements when printing check this topic: How do I hide an element when printing a web page?
And to force new page beetwen workers you need to use another css attributes.
Check this: http://www.javascriptkit.com/dhtmltutors/pagebreak.shtml or http://www.htmlgoodies.com/beyond/css/article.php/3470341/CSS-and-Printing.htm

Related

google-analytics How to view multiple websites in one single account

I´m new on this of Analytics, and I need help on something pretty basic... I have a Demo Account where I noticed the view has 3 different IDs (websites), but all of their stats are shown in one single view.. I have 5 Websites right now on my GA, but I can´t go through making all 5 websites stats to be in one single view.. Any help on this? How can I organise them?
Thanks
Usually you place each website in a separate property. Each property has its own tracking code that you would place on the corresponding site. Instructions for setting up a property can be found here.

Comic navigation in joomla?

I have a joomla site and would like to integrate some old unfinished webcomics to it, so I can pick them up where I stopped in a CMS that won't leave me in an absolute frothing rage (thanks, wordpress).
I've got some experience with Joomla and I believe it would be a pretty good platform for managing multiple comics... except for the small issue of horrid navigation between pages/articles. Joomla's integrated article navigation is a humble but passable start, but if you intend to use categories to organize chapters then getting from the end of one to the beginning of the next is... yeah. This is a pity, as Joomla's category and article management options are beautiful for archiving and presentation, and adding gantry 5 to it means a great deal of control over the reading experience. Basically, joomla has pretty much everything I want, except for the navigation.
Ideally, what I'd like to be able to accomplish for comic navigation in joomla is:
Clickable full-article-image leading to next article/page
Prev/next article buttons (already available)
Prev/next category buttons (do we have those?)
The latter two in a module I can choose where to publish (optional)
And this is it, basically. I understand that implementing the first could be very hard without some major template customization, in which case I'd be willing to insert the image as a link in the article body... but only if there was one single code I could use, like the one that generates the next category article button. Because I'm not willing to create hundreds of menu items to generate links page-by-page.
So is any of this doable?
This is a quick answer but too much for a comment. I'm assuming since you are on SO that you don't mind coding (as opposed to just configuring).
I think you need to do two things. First you need to create a pagination.php for your template. This will let you really super control what the pagination looks like. You can have images, special css and js, whatever you want. You can also add the "last" and "first" options.
I think you need to make a new plugin to replace the core pagenavigation plugin and that also generates the previous/next category links. (Or I guess you could make one just to do categorynavigation depending on what you want.) HOWEVER, it seems to me that there is data on the sibling links that is already being generated in the content category model so you might be able to use that. (Check the code; I think there was never a UI for it, but it is there. Even if it isn't there, siblings are very easy to obtain in nested sets)
The other thing you can really think about if you go that route is changing the whole thing somewhat to use a module that gets the current ID and category ID from JInput. You might also be able to use JPagination. The important thing, however is that you make sure to do the caching the way the pagination that is there does it. In other words you really want to cache the whole list in the order you want so you are not running so many queries and slowing your site down. You may want to look at the categories and category modules to get some ideas about the queries to do.
Hope that gets you started, but it is definitely something you can do without too much trouble.

Drupal: trying to change default for webform form and move the layout of fields

I have been trying to find where I can change the default value for "Per user submission limit" that is under Webform->Form settings in the contents, I have looked all over, but there doesn't seem to be a place that holds the global default that I can change. So right now everytime I try to create an event, I have to manually go in to change it from Unlimited to "Limit each user to 1 submission ever" and the other field is anonymous user is always checked under Submission access... (starting to get really depressed over this)
The other issue I have is that I have no clue how to get the fields to sit side by side, I know how to arrange the order, but can't drupal have fields sit beside each other?
eg: trying to go from this
1
2
3
4
5
to this
1 2
3 4
5
Please cut me some slack, I'm not really a full blown developer, and CMS is right now looking to be more of a pain in the * then it's worth... any help would be appreciated, any good tutorial would help a lot too
almost forgot, I'm using Drupal 7, using Webform Events for a event site (running on LAMP if it matters)
To get your fields side-by-side, you'll want to use CSS. There are ways you could do it in your template code, but that's more trouble than it's worth, and CSS is the better, easier, more suited tool for your task.

Zend framework Nesting controllers

Zend framework Nesting controllers
I was wonder if it is possible to have nested controllers.
I have an application that has a page with left bar and right bar.
| --TAB----TAB----TAB--
MyGroups |
|
So I want to have one controller to be as a wrapper for entire page
then have myGroups controller for left bar, and for right side, there are many tabs that would show based on some selections.
So I want to have one controller for each tab.
This is a very big application and each of those tabs do lots of other things.
So I want have separate controller/model/view/layout for each tab and also for left side's myGroups.
What is the best way to approach this.
I appreciate if you give me some code structure too.
Thank you very much.
Alex
You could use the the Action view-helper in your layout for each or your left and right bars. But the downside to this is that you incur three full server calls (complete with bootstrap and dispatch cycle) to render a single page. I consider that to be a pretty significant downside, especially if each bar needs its own database connection.
An alternative approach is to use front-controller plugins for your left and right bars. Register them at bootstrap, give them a postDispatch() hook which accesses/generates whatever data they need and places that data into the layout/view. Then your layout renders the content without needing to know how it got there.
If you use the 'action view-helper' suggested by David, you could always ajax these in for better UX - therefore the user can read what has currently been loaded, while waiting for the rest of the page.

For ajax - Hashes vs HTML 5 History API?

Before I launch my site, I want to get my URL structure set in stone. A large number of my pages have tabs on them, and it's a much better user experience if when changing a tab, I use ajax to get the relevant changes and just update that, rather than updating the whole page.
Should I use the popular method of just updating the hash of the url for ajax tab changes, or should I just use the HTML 5 history API, and let anyone with browsers that don't support it reload the full page? I've heard people say that websites that use hashes and hashbangs are "breaking the web". Using hashes my urls would look like this: example.com/#popular, and using HTML 5 history my urls would look like this: example.com/?tab=popular.
If you want to serve a different page depending on which tab is selected, then use the HTML 5 history approach. Otherwise just update the hash.
As far as I know, and from my experience it's really six of one and half dozen of another. It's really what you prefer since the end result is the same.

Resources