     
     
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return numberOfItems
+    }
+    
+    var numberOfItems: Int {
         guard let contentGroup = contentGroup else {
             return 0
         }

        }
    }
    
    private func resuseIdentifierAt(_ indexPath: IndexPath) -> String {
        return "ArticleRightAlignedImageCollectionViewCell"
    }
    
    private func articleURL(forItemAt indexPath: IndexPath) -> URL? {

        return content[index]
    }
    
    var eventLoggingLabel: EventLoggingLabel? {
        return contentGroup?.eventLoggingLabel
    }
    
    private func configureArticleCell(_ cell: UICollectionViewCell, forItemAt indexPath: IndexPath, with displayType: WMFFeedDisplayType, layoutOnly: Bool) {
        guard let cell = cell as? ArticleCollectionViewCell, let articleURL = articleURL(forItemAt: indexPath), let article = dataStore?.fetchArticle(with: articleURL) else {
            return
        }
        cell.configure(article: article, displayType: displayType, index: indexPath.row, count: numberOfItems, shouldAdjustMargins: true, theme: theme, layoutOnly: layoutOnly)
        cell.saveButton.eventLoggingLabel = eventLoggingLabel
    }
    
    private func configureNearbyCell(_ cell: UICollectionViewCell, forItemAt indexPath: IndexPath, with displayType: WMFFeedDisplayType, layoutOnly: Bool) {
        guard let cell = cell as? WMFNearbyArticleCollectionViewCell, let articleURL = articleURL(forItemAt: indexPath), let article = dataStore?.fetchArticle(with: articleURL) else {
            return
        }
        cell.titleText = article.displayTitle
        cell.descriptionText = article.capitalizedWikidataDescription
        cell.setImageURL(article.imageURL(forWidth: traitCollection.wmf_nearbyThumbnailWidth))
        (cell as Themeable).apply(theme: theme)
    }
    
    private func configureNewsCell(_ cell: UICollectionViewCell, layoutOnly: Bool) {
        guard let cell = cell as? NewsCollectionViewCell, let story = contentGroup?.contentPreview as? WMFFeedNewsStory else {
            return
        }
        cell.configure(with: story, dataStore: dataStore, theme: theme, layoutOnly: layoutOnly)
    }
    
    private func configureOnThisDayCell(_ cell: UICollectionViewCell, layoutOnly: Bool) {
        guard let cell = cell as? OnThisDayExploreCollectionViewCell, let events = contentGroup?.contentPreview as? [WMFFeedOnThisDayEvent], events.count > 1 else {
            return
        }
        cell.configure(with: events[1], previousEvent: events[0], dataStore: dataStore, theme: theme, layoutOnly: layoutOnly)
    }
    
    private func configurePhotoCell(_ cell: UICollectionViewCell, layoutOnly: Bool) {
        guard let cell = cell as? WMFPicOfTheDayCollectionViewCell, let imageInfo = contentGroup?.contentPreview as? WMFFeedImage else {
            return
        }
        cell.setImageURL(imageInfo.imageThumbURL)
        if imageInfo.imageDescription.count > 0 {
            cell.setDisplayTitle(imageInfo.imageDescription.wmf_stringByRemovingHTML())
        } else {
            cell.setDisplayTitle(imageInfo.canonicalPageTitle)
        }
    }
    
    private func configure(cell: UICollectionViewCell, forItemAt indexPath: IndexPath, layoutOnly: Bool) {
        let displayType = displayTypeAt(indexPath)
        switch displayType {
        case .ranked, .page, .continueReading, .mainPage, .random, .pageWithPreview, .relatedPagesSourceArticle, .relatedPages, .compactList:
            configureArticleCell(cell, forItemAt: indexPath, with: displayType, layoutOnly: layoutOnly)
        case .pageWithLocation:
            configureNearbyCell(cell, forItemAt: indexPath, with: displayType, layoutOnly: layoutOnly)
        case .photo:
            break
        case .story:
            configureNewsCell(cell, layoutOnly: layoutOnly)
        case .event:
             configureOnThisDayCell(cell, layoutOnly: layoutOnly)
        case .theme, .notification, .announcement, .readingList:
            break
        }
    }
    
    
    
    // MARK - WMFColumnarCollectionViewLayoutDelegate
    
